From: Uwe Kleine-König Date: Fri, 19 Dec 2025 09:25:32 +0000 (+0100) Subject: scsi: ch: Convert to SCSI bus methods X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fba333569c8a59928e9e6bb4e20cc6151daeaff8;p=thirdparty%2Fkernel%2Flinux.git scsi: ch: Convert to SCSI bus methods 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. Signed-off-by: Uwe Kleine-König Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/b36de11cbc32265a52264da5c813dd6e1abd21fd.1766133330.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index f2b63e4b9b99e..b6ca23a29ef5a 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c @@ -894,9 +894,9 @@ static long ch_ioctl(struct file *file, /* ------------------------------------------------------------------------ */ -static int ch_probe(struct device *dev) +static int ch_probe(struct scsi_device *sd) { - struct scsi_device *sd = to_scsi_device(dev); + struct device *dev = &sd->sdev_gendev; struct device *class_dev; int ret; scsi_changer *ch; @@ -967,8 +967,9 @@ free_ch: return ret; } -static int ch_remove(struct device *dev) +static void ch_remove(struct scsi_device *sd) { + struct device *dev = &sd->sdev_gendev; scsi_changer *ch = dev_get_drvdata(dev); spin_lock(&ch_index_lock); @@ -979,15 +980,14 @@ static int ch_remove(struct device *dev) device_destroy(&ch_sysfs_class, MKDEV(SCSI_CHANGER_MAJOR, ch->minor)); scsi_device_put(ch->device); kref_put(&ch->ref, ch_destroy); - return 0; } static struct scsi_driver ch_template = { - .gendrv = { + .probe = ch_probe, + .remove = ch_remove, + .gendrv = { .name = "ch", .owner = THIS_MODULE, - .probe = ch_probe, - .remove = ch_remove, }, };