aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2025-06-21 21:43:32 +0200
committerDanilo Krummrich <dakr@kernel.org>2025-07-09 00:04:33 +0200
commit4be5f3fff151e49b0e7a82d33d4d12e91840abde (patch)
tree4d583812a972061439055e98f1684b7201a6a03a /samples
parentrust: auxiliary: use generic device drvdata accessors (diff)
downloadlinux-4be5f3fff151e49b0e7a82d33d4d12e91840abde.tar.gz
linux-4be5f3fff151e49b0e7a82d33d4d12e91840abde.zip
rust: platform: implement Driver::unbind()
Currently, there's really only one core callback for drivers, which is probe(). Now, this isn't entirely true, since there is also the drop() callback of the driver type (serving as the driver's private data), which is returned by probe() and is dropped in remove(). On the C side remove() mainly serves two purposes: (1) Tear down the device that is operated by the driver, e.g. call bus specific functions, write I/O memory to reset the device, etc. (2) Free the resources that have been allocated by a driver for a specific device. The drop() callback mentioned above is intended to cover (2) as the Rust idiomatic way. However, it is partially insufficient and inefficient to cover (1) properly, since drop() can't be called with additional arguments, such as the reference to the corresponding device that has the correct device context, i.e. the Core device context. This makes it inefficient (but not impossible) to access device resources, e.g. to write device registers, and impossible to call device methods, which are only accessible under the Core device context. In order to solve this, add an additional callback for (1), which we call unbind(). The reason for calling it unbind() is that, unlike remove(), it is *only* meant to be used to perform teardown operations on the device (1), but *not* to release resources (2). Link: https://lore.kernel.org/r/20250621195118.124245-7-dakr@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'samples')
0 files changed, 0 insertions, 0 deletions
q-gic-v3-its.c?id=490d332ea42780577f679f5d13598b195bff360c&follow=1'>irqchip/gic-v4.1: Avoid 64bit division for the sake of 32bit ARMMarc Zyngier1-2/+2 2020-02-08fs: Add VirtualBox guest shared folder (vboxsf) supportHans de Goede12-0/+3280 2020-02-08Fix up remaining devm_ioremap_nocache() in SGI IOC3 8250 UART driverLinus Torvalds1-1/+1 2020-02-08pipe: use exclusive waits when reading or writingLinus Torvalds4-30/+51 2020-02-08compat_ioctl: fix FIONREAD on devicesArnd Bergmann1-4/+7 2020-02-08net: thunderx: use proper interface type for RGMIITim Harvey1-1/+1 2020-02-08powerpc: Fix CONFIG_TRACE_IRQFLAGS with CONFIG_VMAP_STACKChristophe Leroy1-1/+1 2020-02-08powerpc/futex: Fix incorrect user access blockingMichael Ellerman1-4/+6 2020-02-08irqchip/gic-v3-its: Rename VPENDBASER/VPROPBASER accessorsZenghui Yu3-24/+24 2020-02-08irqchip/gic-v3-its: Remove superfluous WARN_ONZenghui Yu1-1/+0 2020-02-08irqchip/gic-v4.1: Drop 'tmp' in inherit_vpe_l1_table_from_rd()Zenghui Yu1-3/+1 2020-02-08irqchip/gic-v4.1: Ensure L2 vPE table is allocated at RD levelZenghui Yu1-0/+80 2020-02-08irqchip/gic-v4.1: Set vpe_l1_base for all redistributorsZenghui Yu2-2/+5 2020-02-08irqchip/gic-v4.1: Fix programming of GICR_VPROPBASER_4_1_SIZEZenghui Yu1-1/+1 2020-02-08mt76: mt7615: fix max_nss in mt7615_eeprom_parse_hw_capLorenzo Bianconi1-1/+2 2020-02-07bpf: Improve bucket_log calculation logicMartin KaFai Lau1-2/+3