Skip to content

Commit

Permalink
ibmvscsi: gadget: at91_udc: remove driver_data direct access of struc…
Browse files Browse the repository at this point in the history
…t device

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>
Cc: Brian King <brking@linux.vnet.ibm.com>
Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jun 16, 2009
1 parent 317ccc4 commit 559fde7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/ibmvscsi/ibmvscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
unsigned long wait_switch = 0;
int rc;

vdev->dev.driver_data = NULL;
dev_set_drvdata(&vdev->dev, NULL);

host = scsi_host_alloc(&driver_template, sizeof(*hostdata));
if (!host) {
Expand Down Expand Up @@ -1949,7 +1949,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
scsi_scan_host(host);
}

vdev->dev.driver_data = hostdata;
dev_set_drvdata(&vdev->dev, hostdata);
return 0;

add_srp_port_failed:
Expand All @@ -1968,7 +1968,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)

static int ibmvscsi_remove(struct vio_dev *vdev)
{
struct ibmvscsi_host_data *hostdata = vdev->dev.driver_data;
struct ibmvscsi_host_data *hostdata = dev_get_drvdata(&vdev->dev);
unmap_persist_bufs(hostdata);
release_event_pool(&hostdata->pool, hostdata);
ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata,
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/ibmvscsi/ibmvstgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)

static int ibmvstgt_remove(struct vio_dev *dev)
{
struct srp_target *target = (struct srp_target *) dev->dev.driver_data;
struct srp_target *target = dev_get_drvdata(&dev->dev);
struct Scsi_Host *shost = target->shost;
struct vio_port *vport = target->ldata;

Expand Down

0 comments on commit 559fde7

Please sign in to comment.