提交 559fde70 编写于 作者: G Greg Kroah-Hartman

ibmvscsi: gadget: at91_udc: remove driver_data direct access of struct 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: NGreg Kroah-Hartman <gregkh@suse.de>
上级 317ccc42
...@@ -1877,7 +1877,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -1877,7 +1877,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
unsigned long wait_switch = 0; unsigned long wait_switch = 0;
int rc; int rc;
vdev->dev.driver_data = NULL; dev_set_drvdata(&vdev->dev, NULL);
host = scsi_host_alloc(&driver_template, sizeof(*hostdata)); host = scsi_host_alloc(&driver_template, sizeof(*hostdata));
if (!host) { if (!host) {
...@@ -1949,7 +1949,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -1949,7 +1949,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
scsi_scan_host(host); scsi_scan_host(host);
} }
vdev->dev.driver_data = hostdata; dev_set_drvdata(&vdev->dev, hostdata);
return 0; return 0;
add_srp_port_failed: add_srp_port_failed:
...@@ -1968,7 +1968,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) ...@@ -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) 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); unmap_persist_bufs(hostdata);
release_event_pool(&hostdata->pool, hostdata); release_event_pool(&hostdata->pool, hostdata);
ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata, ibmvscsi_ops->release_crq_queue(&hostdata->queue, hostdata,
......
...@@ -892,7 +892,7 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id) ...@@ -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) 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 Scsi_Host *shost = target->shost;
struct vio_port *vport = target->ldata; struct vio_port *vport = target->ldata;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册