summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2026-01-12 05:33:19 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2026-01-12 05:33:19 +0300
commit3a8a4ee99cb603aa889de18dd4d1cadb7de331a5 (patch)
treed1457719c653e7757fd6c933fbb8caaabe59664b /include
parentae62d62b1c740f7a5ea72082dc28f30ebf6b134d (diff)
parent44859905375ff4d739cca2113408336a90ed227d (diff)
downloadlinux-3a8a4ee99cb603aa889de18dd4d1cadb7de331a5.tar.xz
Merge patch series "scsi: Make use of bus callbacks"
Uwe Kleine-König <u.kleine-koenig@baylibre.com> says: Hello, this is v2 of the series to make the scsi subsystem stop using the callbacks .probe(), .remove() and .shutdown() of struct device_driver. Instead use their designated alternatives in struct bus_type. The eventual goal is to drop the callbacks from struct device_driver. The 2nd patch introduces some legacy handling for drivers still using the device_driver callbacks. This results in a runtime warning (in driver_register()). The following patches convert all in-tree drivers (and thus fix the warnings one after another). Conceptually this legacy handling could be dropped at the end of the series, but I think this is a bad idea because this silently breaks out-of-tree drivers (which also covers drivers that are currently prepared for mainline submission) and in-tree drivers I might have missed (though I'm convinced I catched them all). That convinces me that keeping the legacy handling for at least one development cycle is the right choice. I'll care for that at the latest when I remove the callbacks from struct device_driver. Link: https://patch.msgid.link/cover.1766133330.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/scsi/scsi_driver.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index c0e89996bdb3..249cea724abd 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -12,6 +12,9 @@ struct request;
struct scsi_driver {
struct device_driver gendrv;
+ int (*probe)(struct scsi_device *);
+ void (*remove)(struct scsi_device *);
+ void (*shutdown)(struct scsi_device *);
int (*resume)(struct device *);
void (*rescan)(struct device *);
blk_status_t (*init_command)(struct scsi_cmnd *);
@@ -25,9 +28,9 @@ struct scsi_driver {
#define scsi_register_driver(drv) \
__scsi_register_driver(drv, THIS_MODULE)
-int __scsi_register_driver(struct device_driver *, struct module *);
+int __scsi_register_driver(struct scsi_driver *, struct module *);
#define scsi_unregister_driver(drv) \
- driver_unregister(drv);
+ driver_unregister(&(drv)->gendrv);
extern int scsi_register_interface(struct class_interface *);
#define scsi_unregister_interface(intf) \