aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 15:57:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 15:57:37 -0400
commit6fd03301d76bc439382710e449f58efbb233df1b (patch)
tree3c8a3217aed67319683ffc1debccdb5b3245b16c /drivers/usb
parentcd5232bd6be2d215a800f3d88c287ca791debfbe (diff)
parente4792aa30f9d33584d7192685ed149cc5fee737f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (64 commits) debugfs: use specified mode to possibly mark files read/write only debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem. xen: remove driver_data direct access of struct device from more drivers usb: gadget: at91_udc: remove driver_data direct access of struct device uml: remove driver_data direct access of struct device block/ps3: remove driver_data direct access of struct device s390: remove driver_data direct access of struct device parport: remove driver_data direct access of struct device parisc: remove driver_data direct access of struct device of_serial: remove driver_data direct access of struct device mips: remove driver_data direct access of struct device ipmi: remove driver_data direct access of struct device infiniband: ehca: remove driver_data direct access of struct device ibmvscsi: gadget: at91_udc: remove driver_data direct access of struct device hvcs: remove driver_data direct access of struct device xen block: remove driver_data direct access of struct device thermal: remove driver_data direct access of struct device scsi: remove driver_data direct access of struct device pcmcia: remove driver_data direct access of struct device PCIE: remove driver_data direct access of struct device ... Manually fix up trivial conflicts due to different direct driver_data direct access fixups in drivers/block/{ps3disk.c,ps3vram.c}
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/atm/ueagle-atm.c9
-rw-r--r--drivers/usb/class/usblp.c6
-rw-r--r--drivers/usb/core/file.c13
-rw-r--r--drivers/usb/core/usb.c11
-rw-r--r--drivers/usb/gadget/at91_udc.c6
-rw-r--r--drivers/usb/misc/iowarrior.c6
-rw-r--r--drivers/usb/misc/legousbtower.c6
7 files changed, 49 insertions, 8 deletions
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c
index 9cf9ff69e3e3..d171b563e94c 100644
--- a/drivers/usb/atm/ueagle-atm.c
+++ b/drivers/usb/atm/ueagle-atm.c
@@ -306,6 +306,7 @@ enum {
306#define FW_GET_BYTE(p) *((__u8 *) (p)) 306#define FW_GET_BYTE(p) *((__u8 *) (p))
307 307
308#define FW_DIR "ueagle-atm/" 308#define FW_DIR "ueagle-atm/"
309#define UEA_FW_NAME_MAX 30
309#define NB_MODEM 4 310#define NB_MODEM 4
310 311
311#define BULK_TIMEOUT 300 312#define BULK_TIMEOUT 300
@@ -1564,9 +1565,9 @@ static void cmvs_file_name(struct uea_softc *sc, char *const cmv_name, int ver)
1564 file = cmv_file[sc->modem_index]; 1565 file = cmv_file[sc->modem_index];
1565 1566
1566 strcpy(cmv_name, FW_DIR); 1567 strcpy(cmv_name, FW_DIR);
1567 strlcat(cmv_name, file, FIRMWARE_NAME_MAX); 1568 strlcat(cmv_name, file, UEA_FW_NAME_MAX);
1568 if (ver == 2) 1569 if (ver == 2)
1569 strlcat(cmv_name, ".v2", FIRMWARE_NAME_MAX); 1570 strlcat(cmv_name, ".v2", UEA_FW_NAME_MAX);
1570} 1571}
1571 1572
1572static int request_cmvs_old(struct uea_softc *sc, 1573static int request_cmvs_old(struct uea_softc *sc,
@@ -1574,7 +1575,7 @@ static int request_cmvs_old(struct uea_softc *sc,
1574{ 1575{
1575 int ret, size; 1576 int ret, size;
1576 u8 *data; 1577 u8 *data;
1577 char cmv_name[FIRMWARE_NAME_MAX]; /* 30 bytes stack variable */ 1578 char cmv_name[UEA_FW_NAME_MAX]; /* 30 bytes stack variable */
1578 1579
1579 cmvs_file_name(sc, cmv_name, 1); 1580 cmvs_file_name(sc, cmv_name, 1);
1580 ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); 1581 ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev);
@@ -1608,7 +1609,7 @@ static int request_cmvs(struct uea_softc *sc,
1608 int ret, size; 1609 int ret, size;
1609 u32 crc; 1610 u32 crc;
1610 u8 *data; 1611 u8 *data;
1611 char cmv_name[FIRMWARE_NAME_MAX]; /* 30 bytes stack variable */ 1612 char cmv_name[UEA_FW_NAME_MAX]; /* 30 bytes stack variable */
1612 1613
1613 cmvs_file_name(sc, cmv_name, 2); 1614 cmvs_file_name(sc, cmv_name, 2);
1614 ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev); 1615 ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev);
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index d2747a49b974..26c09f0257db 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -1057,8 +1057,14 @@ static const struct file_operations usblp_fops = {
1057 .release = usblp_release, 1057 .release = usblp_release,
1058}; 1058};
1059 1059
1060static char *usblp_nodename(struct device *dev)
1061{
1062 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
1063}
1064
1060static struct usb_class_driver usblp_class = { 1065static struct usb_class_driver usblp_class = {
1061 .name = "lp%d", 1066 .name = "lp%d",
1067 .nodename = usblp_nodename,
1062 .fops = &usblp_fops, 1068 .fops = &usblp_fops,
1063 .minor_base = USBLP_MINOR_BASE, 1069 .minor_base = USBLP_MINOR_BASE,
1064}; 1070};
diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
index 997e659ff693..5cef88929b3e 100644
--- a/drivers/usb/core/file.c
+++ b/drivers/usb/core/file.c
@@ -67,6 +67,16 @@ static struct usb_class {
67 struct class *class; 67 struct class *class;
68} *usb_class; 68} *usb_class;
69 69
70static char *usb_nodename(struct device *dev)
71{
72 struct usb_class_driver *drv;
73
74 drv = dev_get_drvdata(dev);
75 if (!drv || !drv->nodename)
76 return NULL;
77 return drv->nodename(dev);
78}
79
70static int init_usb_class(void) 80static int init_usb_class(void)
71{ 81{
72 int result = 0; 82 int result = 0;
@@ -90,6 +100,7 @@ static int init_usb_class(void)
90 kfree(usb_class); 100 kfree(usb_class);
91 usb_class = NULL; 101 usb_class = NULL;
92 } 102 }
103 usb_class->class->nodename = usb_nodename;
93 104
94exit: 105exit:
95 return result; 106 return result;
@@ -198,7 +209,7 @@ int usb_register_dev(struct usb_interface *intf,
198 else 209 else
199 temp = name; 210 temp = name;
200 intf->usb_dev = device_create(usb_class->class, &intf->dev, 211 intf->usb_dev = device_create(usb_class->class, &intf->dev,
201 MKDEV(USB_MAJOR, minor), NULL, 212 MKDEV(USB_MAJOR, minor), class_driver,
202 "%s", temp); 213 "%s", temp);
203 if (IS_ERR(intf->usb_dev)) { 214 if (IS_ERR(intf->usb_dev)) {
204 down_write(&minor_rwsem); 215 down_write(&minor_rwsem);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 7eee400d3e32..927a27dd2f85 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -305,10 +305,21 @@ static struct dev_pm_ops usb_device_pm_ops = {
305 305
306#endif /* CONFIG_PM */ 306#endif /* CONFIG_PM */
307 307
308
309static char *usb_nodename(struct device *dev)
310{
311 struct usb_device *usb_dev;
312
313 usb_dev = to_usb_device(dev);
314 return kasprintf(GFP_KERNEL, "bus/usb/%03d/%03d",
315 usb_dev->bus->busnum, usb_dev->devnum);
316}
317
308struct device_type usb_device_type = { 318struct device_type usb_device_type = {
309 .name = "usb_device", 319 .name = "usb_device",
310 .release = usb_release_dev, 320 .release = usb_release_dev,
311 .uevent = usb_dev_uevent, 321 .uevent = usb_dev_uevent,
322 .nodename = usb_nodename,
312 .pm = &usb_device_pm_ops, 323 .pm = &usb_device_pm_ops,
313}; 324};
314 325
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 0b2bb8f0706d..53bcdd2f8282 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1574,7 +1574,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
1574 1574
1575 udc->driver = driver; 1575 udc->driver = driver;
1576 udc->gadget.dev.driver = &driver->driver; 1576 udc->gadget.dev.driver = &driver->driver;
1577 udc->gadget.dev.driver_data = &driver->driver; 1577 dev_set_drvdata(&udc->gadget.dev, &driver->driver);
1578 udc->enabled = 1; 1578 udc->enabled = 1;
1579 udc->selfpowered = 1; 1579 udc->selfpowered = 1;
1580 1580
@@ -1583,7 +1583,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
1583 DBG("driver->bind() returned %d\n", retval); 1583 DBG("driver->bind() returned %d\n", retval);
1584 udc->driver = NULL; 1584 udc->driver = NULL;
1585 udc->gadget.dev.driver = NULL; 1585 udc->gadget.dev.driver = NULL;
1586 udc->gadget.dev.driver_data = NULL; 1586 dev_set_drvdata(&udc->gadget.dev, NULL);
1587 udc->enabled = 0; 1587 udc->enabled = 0;
1588 udc->selfpowered = 0; 1588 udc->selfpowered = 0;
1589 return retval; 1589 return retval;
@@ -1613,7 +1613,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
1613 1613
1614 driver->unbind(&udc->gadget); 1614 driver->unbind(&udc->gadget);
1615 udc->gadget.dev.driver = NULL; 1615 udc->gadget.dev.driver = NULL;
1616 udc->gadget.dev.driver_data = NULL; 1616 dev_set_drvdata(&udc->gadget.dev, NULL);
1617 udc->driver = NULL; 1617 udc->driver = NULL;
1618 1618
1619 DBG("unbound from %s\n", driver->driver.name); 1619 DBG("unbound from %s\n", driver->driver.name);
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index a4ef77ef917d..3c5fe5cee05a 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -726,12 +726,18 @@ static const struct file_operations iowarrior_fops = {
726 .poll = iowarrior_poll, 726 .poll = iowarrior_poll,
727}; 727};
728 728
729static char *iowarrior_nodename(struct device *dev)
730{
731 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
732}
733
729/* 734/*
730 * usb class driver info in order to get a minor number from the usb core, 735 * usb class driver info in order to get a minor number from the usb core,
731 * and to have the device registered with devfs and the driver core 736 * and to have the device registered with devfs and the driver core
732 */ 737 */
733static struct usb_class_driver iowarrior_class = { 738static struct usb_class_driver iowarrior_class = {
734 .name = "iowarrior%d", 739 .name = "iowarrior%d",
740 .nodename = iowarrior_nodename,
735 .fops = &iowarrior_fops, 741 .fops = &iowarrior_fops,
736 .minor_base = IOWARRIOR_MINOR_BASE, 742 .minor_base = IOWARRIOR_MINOR_BASE,
737}; 743};
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index ab0f3226158b..c1e2433f640d 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -266,12 +266,18 @@ static const struct file_operations tower_fops = {
266 .llseek = tower_llseek, 266 .llseek = tower_llseek,
267}; 267};
268 268
269static char *legousbtower_nodename(struct device *dev)
270{
271 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
272}
273
269/* 274/*
270 * usb class driver info in order to get a minor number from the usb core, 275 * usb class driver info in order to get a minor number from the usb core,
271 * and to have the device registered with the driver core 276 * and to have the device registered with the driver core
272 */ 277 */
273static struct usb_class_driver tower_class = { 278static struct usb_class_driver tower_class = {
274 .name = "legousbtower%d", 279 .name = "legousbtower%d",
280 .nodename = legousbtower_nodename,
275 .fops = &tower_fops, 281 .fops = &tower_fops,
276 .minor_base = LEGO_USB_TOWER_MINOR_BASE, 282 .minor_base = LEGO_USB_TOWER_MINOR_BASE,
277}; 283};