Commit 5b2397fd authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB image drivers: remove direct calls to dev_set* and dev_get*

change dev_set_drvdata() and dev_get_drvdata() to
usb_set_intfdata() and usb_get_intfdata()
parent e1dc6e4f
...@@ -130,7 +130,7 @@ hpusbscsi_usb_probe (struct usb_interface *intf, ...@@ -130,7 +130,7 @@ hpusbscsi_usb_probe (struct usb_interface *intf,
/* adding to list for module unload */ /* adding to list for module unload */
list_add (&hpusbscsi_devices, &new->lh); list_add (&hpusbscsi_devices, &new->lh);
dev_set_drvdata(&intf->dev, new); usb_set_intfdata(intf, new);
return 0; return 0;
err_out: err_out:
...@@ -143,9 +143,9 @@ hpusbscsi_usb_probe (struct usb_interface *intf, ...@@ -143,9 +143,9 @@ hpusbscsi_usb_probe (struct usb_interface *intf,
static void static void
hpusbscsi_usb_disconnect (struct usb_interface *intf) hpusbscsi_usb_disconnect (struct usb_interface *intf)
{ {
struct hpusbscsi *desc = dev_get_drvdata(&intf->dev); struct hpusbscsi *desc = usb_get_intfdata(intf);
dev_set_drvdata(&intf->dev, NULL); usb_set_intfdata(intf, NULL);
if (desc) if (desc)
usb_unlink_urb(desc->controlurb); usb_unlink_urb(desc->controlurb);
} }
......
...@@ -523,7 +523,7 @@ static int mdc800_usb_probe (struct usb_interface *intf, ...@@ -523,7 +523,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
up (&mdc800->io_lock); up (&mdc800->io_lock);
dev_set_drvdata(&intf->dev, mdc800); usb_set_intfdata(intf, mdc800);
return 0; return 0;
} }
...@@ -533,7 +533,7 @@ static int mdc800_usb_probe (struct usb_interface *intf, ...@@ -533,7 +533,7 @@ static int mdc800_usb_probe (struct usb_interface *intf,
*/ */
static void mdc800_usb_disconnect (struct usb_interface *intf) static void mdc800_usb_disconnect (struct usb_interface *intf)
{ {
struct mdc800_data* mdc800 = dev_get_drvdata(&intf->dev); struct mdc800_data* mdc800 = usb_get_intfdata(intf);
dbg ("(mdc800_usb_disconnect) called"); dbg ("(mdc800_usb_disconnect) called");
...@@ -552,7 +552,7 @@ static void mdc800_usb_disconnect (struct usb_interface *intf) ...@@ -552,7 +552,7 @@ static void mdc800_usb_disconnect (struct usb_interface *intf)
usb_driver_release_interface (&mdc800_usb_driver, intf); usb_driver_release_interface (&mdc800_usb_driver, intf);
mdc800->dev=0; mdc800->dev=0;
dev_set_drvdata(&intf->dev, NULL); usb_set_intfdata(intf, NULL);
} }
info ("Mustek MDC800 disconnected from USB."); info ("Mustek MDC800 disconnected from USB.");
} }
......
...@@ -774,11 +774,11 @@ static Scsi_Host_Template mts_scsi_host_template = { ...@@ -774,11 +774,11 @@ static Scsi_Host_Template mts_scsi_host_template = {
static void mts_usb_disconnect (struct usb_interface *intf) static void mts_usb_disconnect (struct usb_interface *intf)
{ {
struct mts_desc* to_remove = dev_get_drvdata(&intf->dev); struct mts_desc* to_remove = usb_get_intfdata(intf);
MTS_DEBUG_GOT_HERE(); MTS_DEBUG_GOT_HERE();
dev_set_drvdata(&intf->dev, NULL); usb_set_intfdata(intf, NULL);
if (to_remove) { if (to_remove) {
/* leave the list - lock it */ /* leave the list - lock it */
down(&mts_list_semaphore); down(&mts_list_semaphore);
...@@ -1007,7 +1007,7 @@ static int mts_usb_probe (struct usb_interface *intf, ...@@ -1007,7 +1007,7 @@ static int mts_usb_probe (struct usb_interface *intf,
MTS_DEBUG("completed probe and exiting happily\n"); MTS_DEBUG("completed probe and exiting happily\n");
dev_set_drvdata(&intf->dev, new_desc); usb_set_intfdata(intf, new_desc);
return 0; return 0;
} }
......
...@@ -432,7 +432,7 @@ open_scanner(struct inode * inode, struct file * file) ...@@ -432,7 +432,7 @@ open_scanner(struct inode * inode, struct file * file)
err("open_scanner(%d): Unable to access minor data", scn_minor); err("open_scanner(%d): Unable to access minor data", scn_minor);
return -ENODEV; return -ENODEV;
} }
scn = dev_get_drvdata (&intf->dev); scn = usb_get_intfdata(intf);
dev = scn->scn_dev; dev = scn->scn_dev;
...@@ -1102,7 +1102,7 @@ probe_scanner(struct usb_interface *intf, ...@@ -1102,7 +1102,7 @@ probe_scanner(struct usb_interface *intf,
up(&scn_mutex); up(&scn_mutex);
dev_set_drvdata(&intf->dev, scn); usb_set_intfdata(intf, scn);
/* add device id so the device works when advertised */ /* add device id so the device works when advertised */
intf->kdev = mk_kdev(USB_MAJOR,scn->scn_minor); intf->kdev = mk_kdev(USB_MAJOR,scn->scn_minor);
...@@ -1113,12 +1113,12 @@ probe_scanner(struct usb_interface *intf, ...@@ -1113,12 +1113,12 @@ probe_scanner(struct usb_interface *intf,
static void static void
disconnect_scanner(struct usb_interface *intf) disconnect_scanner(struct usb_interface *intf)
{ {
struct scn_usb_data *scn = dev_get_drvdata(&intf->dev); struct scn_usb_data *scn = usb_get_intfdata(intf);
/* remove device id to disable open() */ /* remove device id to disable open() */
intf->kdev = NODEV; intf->kdev = NODEV;
dev_set_drvdata(&intf->dev, NULL); usb_set_intfdata(intf, NULL);
if (scn) { if (scn) {
down (&scn_mutex); down (&scn_mutex);
down (&(scn->sem)); down (&(scn->sem));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment