scsi: remove driver_data direct access of struct device
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 30 Apr 2009 21:43:31 +0000 (14:43 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Jun 2009 04:30:27 +0000 (21:30 -0700)
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.

Cc: linux-scsi@vger.kernel.org
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/aha1740.c
drivers/scsi/libsrp.c

index ed0e3e55652afdec9c99d480458a5577e1e1a0d0..538135783aab017b0c2ba0ea782801912b0b93a1 100644 (file)
@@ -646,7 +646,7 @@ static int aha1740_probe (struct device *dev)
 
 static __devexit int aha1740_remove (struct device *dev)
 {
-       struct Scsi_Host *shpnt = dev->driver_data;
+       struct Scsi_Host *shpnt = dev_get_drvdata(dev);
        struct aha1740_hostdata *host = HOSTDATA (shpnt);
 
        scsi_remove_host(shpnt);
index 15e2d132e8b9e07b99d39c4079557a3d16604cc3..2742ae8a3d091a13b989fb4f5a7de57e4f7d0490 100644 (file)
@@ -135,7 +135,7 @@ int srp_target_alloc(struct srp_target *target, struct device *dev,
        INIT_LIST_HEAD(&target->cmd_queue);
 
        target->dev = dev;
-       target->dev->driver_data = target;
+       dev_set_drvdata(target->dev, target);
 
        target->srp_iu_size = iu_size;
        target->rx_ring_size = nr;