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: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
317ccc4246
commit
559fde7068
|
@ -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)
|
||||||
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)
|
||||||
|
|
||||||
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 @@ free_vport:
|
||||||
|
|
||||||
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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue