diff options
| author | Martin K. Petersen <martin.petersen@oracle.com> | 2026-01-12 05:33:19 +0300 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2026-01-12 05:33:19 +0300 |
| commit | 3a8a4ee99cb603aa889de18dd4d1cadb7de331a5 (patch) | |
| tree | d1457719c653e7757fd6c933fbb8caaabe59664b /drivers/ufs | |
| parent | ae62d62b1c740f7a5ea72082dc28f30ebf6b134d (diff) | |
| parent | 44859905375ff4d739cca2113408336a90ed227d (diff) | |
| download | linux-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 'drivers/ufs')
| -rw-r--r-- | drivers/ufs/core/ufshcd.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 80c0b49f30b0..78669c205568 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -10525,9 +10525,8 @@ int ufshcd_runtime_resume(struct device *dev) EXPORT_SYMBOL(ufshcd_runtime_resume); #endif /* CONFIG_PM */ -static void ufshcd_wl_shutdown(struct device *dev) +static void ufshcd_wl_shutdown(struct scsi_device *sdev) { - struct scsi_device *sdev = to_scsi_device(dev); struct ufs_hba *hba = shost_priv(sdev->host); down(&hba->host_sem); @@ -11133,9 +11132,9 @@ static int ufshcd_wl_poweroff(struct device *dev) } #endif -static int ufshcd_wl_probe(struct device *dev) +static int ufshcd_wl_probe(struct scsi_device *sdev) { - struct scsi_device *sdev = to_scsi_device(dev); + struct device *dev = &sdev->sdev_gendev; if (!is_device_wlun(sdev)) return -ENODEV; @@ -11147,10 +11146,11 @@ static int ufshcd_wl_probe(struct device *dev) return 0; } -static int ufshcd_wl_remove(struct device *dev) +static void ufshcd_wl_remove(struct scsi_device *sdev) { + struct device *dev = &sdev->sdev_gendev; + pm_runtime_forbid(dev); - return 0; } static const struct dev_pm_ops ufshcd_wl_pm_ops = { @@ -11223,12 +11223,12 @@ static void ufshcd_check_header_layout(void) * Hence register a scsi driver for ufs wluns only. */ static struct scsi_driver ufs_dev_wlun_template = { + .probe = ufshcd_wl_probe, + .remove = ufshcd_wl_remove, + .shutdown = ufshcd_wl_shutdown, .gendrv = { .name = "ufs_device_wlun", - .probe = ufshcd_wl_probe, - .remove = ufshcd_wl_remove, .pm = &ufshcd_wl_pm_ops, - .shutdown = ufshcd_wl_shutdown, }, }; @@ -11240,7 +11240,7 @@ static int __init ufshcd_core_init(void) ufs_debugfs_init(); - ret = scsi_register_driver(&ufs_dev_wlun_template.gendrv); + ret = scsi_register_driver(&ufs_dev_wlun_template); if (ret) ufs_debugfs_exit(); return ret; @@ -11249,7 +11249,7 @@ static int __init ufshcd_core_init(void) static void __exit ufshcd_core_exit(void) { ufs_debugfs_exit(); - scsi_unregister_driver(&ufs_dev_wlun_template.gendrv); + scsi_unregister_driver(&ufs_dev_wlun_template); } module_init(ufshcd_core_init); |
