Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
diff -Nru a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c
--- a/drivers/usb/input/aiptek.c 2005-02-24 11:14:48 -08:00
+++ b/drivers/usb/input/aiptek.c 2005-02-24 11:14:48 -08:00
@@ -297,8 +297,6 @@
int firmwareCode; /* prom/eeprom version */
char usbPath[64 + 1]; /* device's physical usb path */
char inputPath[64 + 1]; /* input device path */
- char manuName[64 + 1]; /* manufacturer name */
- char prodName[64 + 1]; /* product name */
};
struct aiptek_settings {
@@ -1089,7 +1087,7 @@
if (aiptek == NULL)
return 0;
- retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->features.manuName);
+ retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->usbdev->manufacturer);
return retval;
}
@@ -1106,7 +1104,7 @@
if (aiptek == NULL)
return 0;
- retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->features.prodName);
+ retval = snprintf(buf, PAGE_SIZE, "%s\n", aiptek->usbdev->product);
return retval;
}
@@ -2165,19 +2163,6 @@
/* Register the tablet as an Input Device
*/
input_register_device(&aiptek->inputdev);
-
- /* Go and decode the USB representation of the tablet's manufacturer
- * name and product name. They only change once every hotplug event,
- * which is why we put it here instead of in the sysfs interface.
- */
- usb_string(usbdev,
- usbdev->descriptor.iManufacturer,
- aiptek->features.manuName,
- sizeof(aiptek->features.manuName));
- usb_string(usbdev,
- usbdev->descriptor.iProduct,
- aiptek->features.prodName,
- sizeof(aiptek->features.prodName));
/* We now will look for the evdev device which is mapped to
* the tablet. The partial name is kept in the link list of
diff -Nru a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c
--- a/drivers/usb/input/ati_remote.c 2005-02-24 11:14:48 -08:00
+++ b/drivers/usb/input/ati_remote.c 2005-02-24 11:14:48 -08:00
@@ -718,7 +718,6 @@
struct usb_host_interface *iface_host;
int retval = -ENOMEM;
char path[64];
- char *buf = NULL;
/* Allocate and clear an ati_remote struct */
if (!(ati_remote = kmalloc(sizeof (struct ati_remote), GFP_KERNEL)))
@@ -752,8 +751,6 @@
retval = -ENODEV;
goto error;
}
- if (!(buf = kmalloc(NAME_BUFSIZE, GFP_KERNEL)))
- goto error;
/* Allocate URB buffers, URBs */
ati_remote->inbuf = usb_buffer_alloc(udev, DATA_BUFSIZE, SLAB_ATOMIC,
@@ -776,14 +773,11 @@
usb_make_path(udev, path, NAME_BUFSIZE);
sprintf(ati_remote->phys, "%s/input%d", path, ATI_INPUTNUM);
- if (udev->descriptor.iManufacturer &&
- (usb_string(udev, udev->descriptor.iManufacturer, buf,
- NAME_BUFSIZE) > 0))
- strcat(ati_remote->name, buf);
-
- if (udev->descriptor.iProduct &&
- (usb_string(udev, udev->descriptor.iProduct, buf, NAME_BUFSIZE) >
0))
- sprintf(ati_remote->name, "%s %s", ati_remote->name, buf);
+ if (udev->manufacturer)
+ strcat(ati_remote->name, udev->manufacturer);
+
+ if (udev->product)
+ sprintf(ati_remote->name, "%s %s", ati_remote->name,
udev->product);
if (!strlen(ati_remote->name))
sprintf(ati_remote->name, DRIVER_DESC "(%04x,%04x)",
@@ -806,9 +800,6 @@
ati_remote->present = 1;
error:
- if (buf)
- kfree(buf);
-
if (retval)
ati_remote_delete(ati_remote);
diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c 2005-02-24 11:14:48 -08:00
+++ b/drivers/usb/input/hid-core.c 2005-02-24 11:14:48 -08:00
@@ -1727,12 +1727,12 @@
if (!(buf = kmalloc(64, GFP_KERNEL)))
goto fail;
- if (usb_string(dev, dev->descriptor.iManufacturer, buf, 64) > 0) {
- strcat(hid->name, buf);
- if (usb_string(dev, dev->descriptor.iProduct, buf, 64) > 0)
- snprintf(hid->name, 64, "%s %s", hid->name, buf);
- } else if (usb_string(dev, dev->descriptor.iProduct, buf, 64) > 0) {
- snprintf(hid->name, 128, "%s", buf);
+ if (dev->manufacturer) {
+ strcat(hid->name, dev->manufacturer);
+ if (dev->product)
+ snprintf(hid->name, 64, "%s %s", hid->name,
dev->product);
+ } else if (dev->product) {
+ snprintf(hid->name, 128, "%s", dev->product);
} else
snprintf(hid->name, 128, "%04x:%04x",
le16_to_cpu(dev->descriptor.idVendor),
diff -Nru a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c
--- a/drivers/usb/input/mtouchusb.c 2005-02-24 11:14:48 -08:00
+++ b/drivers/usb/input/mtouchusb.c 2005-02-24 11:14:48 -08:00
@@ -187,7 +187,6 @@
struct usb_endpoint_descriptor *endpoint;
struct usb_device *udev = interface_to_usbdev (intf);
char path[64];
- char *buf;
int nRet;
dbg("%s - called", __FUNCTION__);
@@ -242,23 +241,14 @@
mtouch->input.absfuzz[ABS_Y] = MTOUCHUSB_YC_FUZZ;
mtouch->input.absflat[ABS_Y] = MTOUCHUSB_YC_FLAT;
- if (!(buf = kmalloc(63, GFP_KERNEL))) {
- kfree(mtouch);
- return -ENOMEM;
- }
-
- if (udev->descriptor.iManufacturer &&
- usb_string(udev, udev->descriptor.iManufacturer, buf, 63) > 0)
- strcat(mtouch->name, buf);
- if (udev->descriptor.iProduct &&
- usb_string(udev, udev->descriptor.iProduct, buf, 63) > 0)
- sprintf(mtouch->name, "%s %s", mtouch->name, buf);
+ if (udev->manufacturer)
+ strcat(mtouch->name, udev->manufacturer);
+ if (udev->product)
+ sprintf(mtouch->name, "%s %s", mtouch->name, udev->product);
if (!strlen(mtouch->name))
sprintf(mtouch->name, "USB Touchscreen %04x:%04x",
mtouch->input.id.vendor, mtouch->input.id.product);
-
- kfree(buf);
nRet = usb_control_msg(mtouch->udev,
usb_rcvctrlpipe(udev, 0),
diff -Nru a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c
--- a/drivers/usb/input/touchkitusb.c 2005-02-24 11:14:48 -08:00
+++ b/drivers/usb/input/touchkitusb.c 2005-02-24 11:14:48 -08:00
@@ -184,7 +184,6 @@
struct usb_endpoint_descriptor *endpoint;
struct usb_device *udev = interface_to_usbdev(intf);
char path[64];
- char *buf;
interface = intf->cur_altsetting;
endpoint = &interface->endpoint[0].desc;
@@ -230,24 +229,14 @@
touchkit->input.absfuzz[ABS_Y] = TOUCHKIT_YC_FUZZ;
touchkit->input.absflat[ABS_Y] = TOUCHKIT_YC_FLAT;
- buf = kmalloc(63, GFP_KERNEL);
- if (!buf) {
- ret = -ENOMEM;
- goto out_free_buffers;
- }
-
- if (udev->descriptor.iManufacturer &&
- usb_string(udev, udev->descriptor.iManufacturer, buf, 63) > 0)
- strcat(touchkit->name, buf);
- if (udev->descriptor.iProduct &&
- usb_string(udev, udev->descriptor.iProduct, buf, 63) > 0)
- sprintf(touchkit->name, "%s %s", touchkit->name, buf);
+ if (udev->manufacturer)
+ strcat(touchkit->name, udev->manufacturer);
+ if (udev->product)
+ sprintf(touchkit->name, "%s %s", touchkit->name, udev->product);
if (!strlen(touchkit->name))
sprintf(touchkit->name, "USB Touchscreen %04x:%04x",
touchkit->input.id.vendor, touchkit->input.id.product);
-
- kfree(buf);
touchkit->irq = usb_alloc_urb(0, GFP_KERNEL);
if (!touchkit->irq) {
diff -Nru a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c
--- a/drivers/usb/input/usbkbd.c 2005-02-24 11:14:48 -08:00
+++ b/drivers/usb/input/usbkbd.c 2005-02-24 11:14:48 -08:00
@@ -238,7 +238,6 @@
struct usb_kbd *kbd;
int i, pipe, maxp;
char path[64];
- char *buf;
interface = iface->cur_altsetting;
@@ -301,25 +300,14 @@
kbd->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice);
kbd->dev.dev = &iface->dev;
- if (!(buf = kmalloc(63, GFP_KERNEL))) {
- usb_free_urb(kbd->irq);
- usb_kbd_free_mem(dev, kbd);
- kfree(kbd);
- return -ENOMEM;
- }
-
- if (dev->descriptor.iManufacturer &&
- usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
- strcat(kbd->name, buf);
- if (dev->descriptor.iProduct &&
- usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
- sprintf(kbd->name, "%s %s", kbd->name, buf);
+ if (dev->manufacturer)
+ strcat(kbd->name, dev->manufacturer);
+ if (dev->product)
+ sprintf(kbd->name, "%s %s", kbd->name, dev->product);
if (!strlen(kbd->name))
sprintf(kbd->name, "USB HIDBP Keyboard %04x:%04x",
kbd->dev.id.vendor, kbd->dev.id.product);
-
- kfree(buf);
usb_fill_control_urb(kbd->led, dev, usb_sndctrlpipe(dev, 0),
(void *) kbd->cr, kbd->leds, 1,
diff -Nru a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c
--- a/drivers/usb/input/usbmouse.c 2005-02-24 11:14:48 -08:00
+++ b/drivers/usb/input/usbmouse.c 2005-02-24 11:14:48 -08:00
@@ -129,7 +129,6 @@
struct usb_mouse *mouse;
int pipe, maxp;
char path[64];
- char *buf;
interface = intf->cur_altsetting;
@@ -185,24 +184,14 @@
mouse->dev.id.version = le16_to_cpu(dev->descriptor.bcdDevice);
mouse->dev.dev = &intf->dev;
- if (!(buf = kmalloc(63, GFP_KERNEL))) {
- usb_buffer_free(dev, 8, mouse->data, mouse->data_dma);
- kfree(mouse);
- return -ENOMEM;
- }
-
- if (dev->descriptor.iManufacturer &&
- usb_string(dev, dev->descriptor.iManufacturer, buf, 63) > 0)
- strcat(mouse->name, buf);
- if (dev->descriptor.iProduct &&
- usb_string(dev, dev->descriptor.iProduct, buf, 63) > 0)
- sprintf(mouse->name, "%s %s", mouse->name, buf);
+ if (dev->manufacturer)
+ strcat(mouse->name, dev->manufacturer);
+ if (dev->product)
+ sprintf(mouse->name, "%s %s", mouse->name, dev->product);
if (!strlen(mouse->name))
sprintf(mouse->name, "USB HIDBP Mouse %04x:%04x",
mouse->dev.id.vendor, mouse->dev.id.product);
-
- kfree(buf);
usb_fill_int_urb(mouse->irq, dev, pipe, mouse->data,
(maxp > 8 ? 8 : maxp),
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel