summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>2025-12-19 12:25:36 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2026-01-12 05:31:58 +0300
commit4bc2205be4609b7a224c78e12852a672cbf80d3d (patch)
treef69fca0964d680c9888619bd4bbad13f28c99d5b
parent9ccda35df7d5cf46649d02696278c7cd4464a16d (diff)
downloadlinux-4bc2205be4609b7a224c78e12852a672cbf80d3d.tar.xz
scsi: st: 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 <u.kleine-koenig@baylibre.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/6da44731f77e8fdcd18e5f438643d58c98945db4.1766133330.git.u.kleine-koenig@baylibre.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/st.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 45622cfce926..40d88bbb4388 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -202,14 +202,14 @@ static int sgl_map_user_pages(struct st_buffer *, const unsigned int,
unsigned long, size_t, int);
static int sgl_unmap_user_pages(struct st_buffer *, const unsigned int, int);
-static int st_probe(struct device *);
-static int st_remove(struct device *);
+static int st_probe(struct scsi_device *);
+static void st_remove(struct scsi_device *);
static struct scsi_driver st_template = {
+ .probe = st_probe,
+ .remove = st_remove,
.gendrv = {
.name = "st",
- .probe = st_probe,
- .remove = st_remove,
.groups = st_drv_groups,
},
};
@@ -4342,9 +4342,9 @@ static void remove_cdevs(struct scsi_tape *tape)
}
}
-static int st_probe(struct device *dev)
+static int st_probe(struct scsi_device *SDp)
{
- struct scsi_device *SDp = to_scsi_device(dev);
+ struct device *dev = &SDp->sdev_gendev;
struct scsi_tape *tpnt = NULL;
struct st_modedef *STm;
struct st_partstat *STps;
@@ -4499,12 +4499,13 @@ out:
};
-static int st_remove(struct device *dev)
+static void st_remove(struct scsi_device *SDp)
{
+ struct device *dev = &SDp->sdev_gendev;
struct scsi_tape *tpnt = dev_get_drvdata(dev);
int index = tpnt->index;
- scsi_autopm_get_device(to_scsi_device(dev));
+ scsi_autopm_get_device(SDp);
remove_cdevs(tpnt);
mutex_lock(&st_ref_mutex);
@@ -4513,7 +4514,6 @@ static int st_remove(struct device *dev)
spin_lock(&st_index_lock);
idr_remove(&st_index_idr, index);
spin_unlock(&st_index_lock);
- return 0;
}
/**