summaryrefslogtreecommitdiff
path: root/drivers/scsi/sd.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-03-08 08:51:49 +0300
committerJens Axboe <axboe@kernel.dk>2022-03-09 05:40:00 +0300
commite7f76552277ca79d9dfe4c59f7b3620a98467f9c (patch)
tree251b58be6faf96d6f9e383678f1f344b89d2d9bc /drivers/scsi/sd.h
parente02657ea7b86d1c41e095f49e4f7c7bb24bbee64 (diff)
downloadlinux-e7f76552277ca79d9dfe4c59f7b3620a98467f9c.tar.xz
scsi: don't use disk->private_data to find the scsi_driver
Requiring every ULP to have the scsi_drive as first member of the private data is rather fragile and not necessary anyway. Just use the driver hanging off the SCSI device instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20220308055200.735835-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/sd.h')
-rw-r--r--drivers/scsi/sd.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index 2e5932bde43d..303aa1c23aef 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -68,7 +68,6 @@ enum {
};
struct scsi_disk {
- struct scsi_driver *driver; /* always &sd_template */
struct scsi_device *device;
struct device dev;
struct gendisk *disk;
@@ -131,7 +130,7 @@ struct scsi_disk {
static inline struct scsi_disk *scsi_disk(struct gendisk *disk)
{
- return container_of(disk->private_data, struct scsi_disk, driver);
+ return disk->private_data;
}
#define sd_printk(prefix, sdsk, fmt, a...) \