* [PATCH v2 1/8] scsi: Pass a struct scsi_driver to scsi_{,un}register_driver()
2025-12-19 9:25 [PATCH v2 0/8] scsi: Make use of bus callbacks Uwe Kleine-König
@ 2025-12-19 9:25 ` Uwe Kleine-König
2025-12-19 9:25 ` [PATCH v2 2/8] scsi: Make use of bus callbacks Uwe Kleine-König
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2025-12-19 9:25 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen, Kai Mäkisara
Cc: Alim Akhtar, Avri Altman, Bart Van Assche, Matthias Brugger,
AngeloGioacchino Del Regno, Peter Wang, Bean Huo, Adrian Hunter,
Bao D. Nguyen, linux-scsi, linux-arm-kernel, linux-mediatek
This aligns with what other subsystems do, reduces boilerplate a bit for
device drivers and is less error prone.
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/scsi/ch.c | 4 ++--
drivers/scsi/scsi_sysfs.c | 4 +++-
drivers/scsi/sd.c | 4 ++--
drivers/scsi/ses.c | 4 ++--
drivers/scsi/sr.c | 4 ++--
drivers/scsi/st.c | 4 ++--
drivers/ufs/core/ufshcd.c | 4 ++--
include/scsi/scsi_driver.h | 4 ++--
8 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index fa07a6f54003..f2b63e4b9b99 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -1014,7 +1014,7 @@ static int __init init_ch_module(void)
SCSI_CHANGER_MAJOR);
goto fail1;
}
- rc = scsi_register_driver(&ch_template.gendrv);
+ rc = scsi_register_driver(&ch_template);
if (rc < 0)
goto fail2;
return 0;
@@ -1028,7 +1028,7 @@ static int __init init_ch_module(void)
static void __exit exit_ch_module(void)
{
- scsi_unregister_driver(&ch_template.gendrv);
+ scsi_unregister_driver(&ch_template);
unregister_chrdev(SCSI_CHANGER_MAJOR, "ch");
class_unregister(&ch_sysfs_class);
idr_destroy(&ch_index_idr);
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 99eb0a30df61..db0ba68f2e6e 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1554,8 +1554,10 @@ void scsi_remove_target(struct device *dev)
}
EXPORT_SYMBOL(scsi_remove_target);
-int __scsi_register_driver(struct device_driver *drv, struct module *owner)
+int __scsi_register_driver(struct scsi_driver *sdrv, struct module *owner)
{
+ struct device_driver *drv = &sdrv->gendrv;
+
drv->bus = &scsi_bus_type;
drv->owner = owner;
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index f50b92e63201..6ea6ee2830a4 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -4417,7 +4417,7 @@ static int __init init_sd(void)
goto err_out_class;
}
- err = scsi_register_driver(&sd_template.gendrv);
+ err = scsi_register_driver(&sd_template);
if (err)
goto err_out_driver;
@@ -4444,7 +4444,7 @@ static void __exit exit_sd(void)
SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n"));
- scsi_unregister_driver(&sd_template.gendrv);
+ scsi_unregister_driver(&sd_template);
mempool_destroy(sd_page_pool);
class_unregister(&sd_disk_class);
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 2c61624cb4b0..f8f5164f3de2 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -921,7 +921,7 @@ static int __init ses_init(void)
if (err)
return err;
- err = scsi_register_driver(&ses_template.gendrv);
+ err = scsi_register_driver(&ses_template);
if (err)
goto out_unreg;
@@ -934,7 +934,7 @@ static int __init ses_init(void)
static void __exit ses_exit(void)
{
- scsi_unregister_driver(&ses_template.gendrv);
+ scsi_unregister_driver(&ses_template);
scsi_unregister_interface(&ses_interface);
}
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index add13e306898..2f6bb6355186 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -1001,7 +1001,7 @@ static int __init init_sr(void)
rc = register_blkdev(SCSI_CDROM_MAJOR, "sr");
if (rc)
return rc;
- rc = scsi_register_driver(&sr_template.gendrv);
+ rc = scsi_register_driver(&sr_template);
if (rc)
unregister_blkdev(SCSI_CDROM_MAJOR, "sr");
@@ -1010,7 +1010,7 @@ static int __init init_sr(void)
static void __exit exit_sr(void)
{
- scsi_unregister_driver(&sr_template.gendrv);
+ scsi_unregister_driver(&sr_template);
unregister_blkdev(SCSI_CDROM_MAJOR, "sr");
}
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 168f25e4aaa3..45622cfce926 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4576,7 +4576,7 @@ static int __init init_st(void)
goto err_class;
}
- err = scsi_register_driver(&st_template.gendrv);
+ err = scsi_register_driver(&st_template);
if (err)
goto err_chrdev;
@@ -4592,7 +4592,7 @@ static int __init init_st(void)
static void __exit exit_st(void)
{
- scsi_unregister_driver(&st_template.gendrv);
+ scsi_unregister_driver(&st_template);
unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0),
ST_MAX_TAPE_ENTRIES);
class_unregister(&st_sysfs_class);
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 80c0b49f30b0..da1e89e95d07 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -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);
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index c0e89996bdb3..40aba9a9349a 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -25,9 +25,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) \
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 2/8] scsi: Make use of bus callbacks
2025-12-19 9:25 [PATCH v2 0/8] scsi: Make use of bus callbacks Uwe Kleine-König
2025-12-19 9:25 ` [PATCH v2 1/8] scsi: Pass a struct scsi_driver to scsi_{,un}register_driver() Uwe Kleine-König
@ 2025-12-19 9:25 ` Uwe Kleine-König
2025-12-19 18:18 ` Bart Van Assche
2025-12-22 8:28 ` Peter Wang (王信友)
2025-12-19 9:25 ` [PATCH v2 8/8] scsi: ufs: Convert to scsi bus methods Uwe Kleine-König
` (3 subsequent siblings)
5 siblings, 2 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2025-12-19 9:25 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen, Kai Mäkisara
Cc: linux-scsi, Alim Akhtar, Avri Altman, Bart Van Assche,
Matthias Brugger, AngeloGioacchino Del Regno, Peter Wang,
Bean Huo, Adrian Hunter, Bao D. Nguyen, linux-arm-kernel,
linux-mediatek
Introduce a bus specific probe, remove and shutdown function. For now
this only allows to get rid of a cast of the generic device to an scsi
device in the drivers and changes the remove prototype to return
void---a non-zero return value is ignored anyhow.
The objective is to get rid of users of struct device_driver callbacks
.probe(), .remove() and .shutdown() to eventually remove these. Until
all scsi drivers are converted this results in a runtime warning about
the drivers needing an update because there is a bus probe function and
a driver probe function. The in-tree drivers are fixed by the following
commits.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/scsi/scsi_sysfs.c | 73 ++++++++++++++++++++++++++++++++++++--
include/scsi/scsi_driver.h | 3 ++
2 files changed, 74 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index db0ba68f2e6e..6b8c5c05f294 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -554,10 +554,48 @@ static int scsi_bus_uevent(const struct device *dev, struct kobj_uevent_env *env
return 0;
}
+static int scsi_bus_probe(struct device *dev)
+{
+ struct scsi_device *sdp = to_scsi_device(dev);
+ struct scsi_driver *drv = to_scsi_driver(dev->driver);
+
+ if (drv->probe)
+ return drv->probe(sdp);
+ else
+ return 0;
+}
+
+static void scsi_bus_remove(struct device *dev)
+{
+ struct scsi_device *sdp = to_scsi_device(dev);
+ struct scsi_driver *drv = to_scsi_driver(dev->driver);
+
+ if (drv->remove)
+ drv->remove(sdp);
+}
+
+static void scsi_bus_shutdown(struct device *dev)
+{
+ struct scsi_device *sdp = to_scsi_device(dev);
+ struct scsi_driver *drv;
+
+ if (!dev->driver)
+ return;
+
+ drv = to_scsi_driver(dev->driver);
+
+ if (drv->shutdown)
+ drv->shutdown(sdp);
+}
+
+
const struct bus_type scsi_bus_type = {
- .name = "scsi",
- .match = scsi_bus_match,
+ .name = "scsi",
+ .match = scsi_bus_match,
.uevent = scsi_bus_uevent,
+ .probe = scsi_bus_probe,
+ .remove = scsi_bus_remove,
+ .shutdown = scsi_bus_shutdown,
#ifdef CONFIG_PM
.pm = &scsi_bus_pm_ops,
#endif
@@ -1554,6 +1592,30 @@ void scsi_remove_target(struct device *dev)
}
EXPORT_SYMBOL(scsi_remove_target);
+static int scsi_legacy_probe(struct scsi_device *sdp)
+{
+ struct device *dev = &sdp->sdev_gendev;
+ struct device_driver *driver = dev->driver;
+
+ return driver->probe(dev);
+}
+
+static void scsi_legacy_remove(struct scsi_device *sdp)
+{
+ struct device *dev = &sdp->sdev_gendev;
+ struct device_driver *driver = dev->driver;
+
+ driver->remove(dev);
+}
+
+static void scsi_legacy_shutdown(struct scsi_device *sdp)
+{
+ struct device *dev = &sdp->sdev_gendev;
+ struct device_driver *driver = dev->driver;
+
+ driver->shutdown(dev);
+}
+
int __scsi_register_driver(struct scsi_driver *sdrv, struct module *owner)
{
struct device_driver *drv = &sdrv->gendrv;
@@ -1561,6 +1623,13 @@ int __scsi_register_driver(struct scsi_driver *sdrv, struct module *owner)
drv->bus = &scsi_bus_type;
drv->owner = owner;
+ if (!sdrv->probe && drv->probe)
+ sdrv->probe = scsi_legacy_probe;
+ if (!sdrv->remove && drv->remove)
+ sdrv->remove = scsi_legacy_remove;
+ if (!sdrv->shutdown && drv->shutdown)
+ sdrv->shutdown = scsi_legacy_shutdown;
+
return driver_register(drv);
}
EXPORT_SYMBOL(__scsi_register_driver);
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 40aba9a9349a..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 *);
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 2/8] scsi: Make use of bus callbacks
2025-12-19 9:25 ` [PATCH v2 2/8] scsi: Make use of bus callbacks Uwe Kleine-König
@ 2025-12-19 18:18 ` Bart Van Assche
2025-12-22 8:28 ` Peter Wang (王信友)
1 sibling, 0 replies; 9+ messages in thread
From: Bart Van Assche @ 2025-12-19 18:18 UTC (permalink / raw)
To: Uwe Kleine-König, James E.J. Bottomley, Martin K. Petersen,
Kai Mäkisara
Cc: linux-scsi, Alim Akhtar, Avri Altman, Matthias Brugger,
AngeloGioacchino Del Regno, Peter Wang, Bean Huo, Adrian Hunter,
Bao D. Nguyen, linux-arm-kernel, linux-mediatek
On 12/19/25 1:25 AM, Uwe Kleine-König wrote:
> +static int scsi_bus_probe(struct device *dev)
> +{
> + struct scsi_device *sdp = to_scsi_device(dev);
> + struct scsi_driver *drv = to_scsi_driver(dev->driver);
> +
> + if (drv->probe)
> + return drv->probe(sdp);
> + else
> + return 0;
> +}
If this series has to be reposted, please leave out the "else" statement
from the above function. It is uncommon in Linux kernel code to have an
"else" statement after a "return" statement.
Thanks,
Bart.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 2/8] scsi: Make use of bus callbacks
2025-12-19 9:25 ` [PATCH v2 2/8] scsi: Make use of bus callbacks Uwe Kleine-König
2025-12-19 18:18 ` Bart Van Assche
@ 2025-12-22 8:28 ` Peter Wang (王信友)
1 sibling, 0 replies; 9+ messages in thread
From: Peter Wang (王信友) @ 2025-12-22 8:28 UTC (permalink / raw)
To: Uwe Kleine, James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, Kai.Makisara@kolumbus.fi
Cc: avri.altman@wdc.com, beanhuo@micron.com, quic_nguyenb@quicinc.com,
linux-scsi@vger.kernel.org, AngeloGioacchino Del Regno,
bvanassche@acm.org, adrian.hunter@intel.com,
alim.akhtar@samsung.com, linux-arm-kernel@lists.infradead.org,
matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org
On Fri, 2025-12-19 at 10:25 +0100, Uwe Kleine-König wrote:
> Introduce a bus specific probe, remove and shutdown function. For now
> this only allows to get rid of a cast of the generic device to an
> scsi
> device in the drivers and changes the remove prototype to return
> void---a non-zero return value is ignored anyhow.
>
> The objective is to get rid of users of struct device_driver
> callbacks
> .probe(), .remove() and .shutdown() to eventually remove these. Until
> all scsi drivers are converted this results in a runtime warning
> about
> the drivers needing an update because there is a bus probe function
> and
> a driver probe function. The in-tree drivers are fixed by the
> following
> commits.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 8/8] scsi: ufs: Convert to scsi bus methods
2025-12-19 9:25 [PATCH v2 0/8] scsi: Make use of bus callbacks Uwe Kleine-König
2025-12-19 9:25 ` [PATCH v2 1/8] scsi: Pass a struct scsi_driver to scsi_{,un}register_driver() Uwe Kleine-König
2025-12-19 9:25 ` [PATCH v2 2/8] scsi: Make use of bus callbacks Uwe Kleine-König
@ 2025-12-19 9:25 ` Uwe Kleine-König
2025-12-19 18:16 ` [PATCH v2 0/8] scsi: Make use of bus callbacks Bart Van Assche
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2025-12-19 9:25 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen
Cc: Alim Akhtar, Avri Altman, Bart Van Assche, Matthias Brugger,
AngeloGioacchino Del Regno, Peter Wang, Bean Huo, Adrian Hunter,
Bao D. Nguyen, linux-scsi, linux-arm-kernel, linux-mediatek
The scsi subsystem has implemented dedicated callbacks for probe, remove
and shutdown. Make use of them. This fixes a runtime warning about the
driver needing to be converted to the bus probe method.
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/ufs/core/ufshcd.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index da1e89e95d07..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,
},
};
--
2.47.3
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/8] scsi: Make use of bus callbacks
2025-12-19 9:25 [PATCH v2 0/8] scsi: Make use of bus callbacks Uwe Kleine-König
` (2 preceding siblings ...)
2025-12-19 9:25 ` [PATCH v2 8/8] scsi: ufs: Convert to scsi bus methods Uwe Kleine-König
@ 2025-12-19 18:16 ` Bart Van Assche
2026-01-12 2:34 ` Martin K. Petersen
2026-01-17 4:36 ` Martin K. Petersen
5 siblings, 0 replies; 9+ messages in thread
From: Bart Van Assche @ 2025-12-19 18:16 UTC (permalink / raw)
To: Uwe Kleine-König, James E.J. Bottomley, Martin K. Petersen,
Kai Mäkisara
Cc: Alim Akhtar, Avri Altman, Matthias Brugger,
AngeloGioacchino Del Regno, Peter Wang, Bean Huo, Adrian Hunter,
Christoph Hellwig, Bao D. Nguyen, linux-scsi, linux-arm-kernel,
linux-mediatek
On 12/19/25 1:25 AM, Uwe Kleine-König wrote:
> 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.
For the entire series:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/8] scsi: Make use of bus callbacks
2025-12-19 9:25 [PATCH v2 0/8] scsi: Make use of bus callbacks Uwe Kleine-König
` (3 preceding siblings ...)
2025-12-19 18:16 ` [PATCH v2 0/8] scsi: Make use of bus callbacks Bart Van Assche
@ 2026-01-12 2:34 ` Martin K. Petersen
2026-01-17 4:36 ` Martin K. Petersen
5 siblings, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2026-01-12 2:34 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: James E.J. Bottomley, Martin K. Petersen, Kai Mäkisara,
Alim Akhtar, Avri Altman, Bart Van Assche, Matthias Brugger,
AngeloGioacchino Del Regno, Peter Wang, Bean Huo, Adrian Hunter,
Christoph Hellwig, Bao D. Nguyen, linux-scsi, linux-arm-kernel,
linux-mediatek
Uwe,
> 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.
Applied to 6.20/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/8] scsi: Make use of bus callbacks
2025-12-19 9:25 [PATCH v2 0/8] scsi: Make use of bus callbacks Uwe Kleine-König
` (4 preceding siblings ...)
2026-01-12 2:34 ` Martin K. Petersen
@ 2026-01-17 4:36 ` Martin K. Petersen
5 siblings, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2026-01-17 4:36 UTC (permalink / raw)
To: James E.J. Bottomley, Kai Mäkisara, Uwe Kleine-König
Cc: Martin K . Petersen, Alim Akhtar, Avri Altman, Bart Van Assche,
Matthias Brugger, AngeloGioacchino Del Regno, Peter Wang,
Bean Huo, Adrian Hunter, Christoph Hellwig, Bao D. Nguyen,
linux-scsi, linux-arm-kernel, linux-mediatek
On Fri, 19 Dec 2025 10:25:29 +0100, Uwe Kleine-König wrote:
> 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.
>
> [...]
Applied to 6.20/scsi-queue, thanks!
[1/8] scsi: Pass a struct scsi_driver to scsi_{,un}register_driver()
https://git.kernel.org/mkp/scsi/c/7d42bcea57ae
[2/8] scsi: Make use of bus callbacks
https://git.kernel.org/mkp/scsi/c/f7d4f1bf5724
[3/8] scsi: ch: Convert to scsi bus methods
https://git.kernel.org/mkp/scsi/c/fba333569c8a
[4/8] scsi: sd: Convert to scsi bus methods
https://git.kernel.org/mkp/scsi/c/63b541f054e7
[5/8] scsi: ses: Convert to scsi bus methods
https://git.kernel.org/mkp/scsi/c/a71d5deea6e9
[6/8] scsi: sr: Convert to scsi bus methods
https://git.kernel.org/mkp/scsi/c/9ccda35df7d5
[7/8] scsi: st: Convert to scsi bus methods
https://git.kernel.org/mkp/scsi/c/4bc2205be460
[8/8] scsi: ufs: Convert to scsi bus methods
https://git.kernel.org/mkp/scsi/c/44859905375f
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 9+ messages in thread