From 066202dd48cf3296b6cc22b5fcf89aef33fa0efc Mon Sep 17 00:00:00 2001 From: "Luiz Fernando N. Capitulino" Date: Sat, 5 Aug 2006 20:37:11 -0300 Subject: USB: Make file operations structs in drivers/usb const. Making structs const prevents accidental bugs and with the proper debug options they're protected against corruption. Signed-off-by: Luiz Fernando N. Capitulino Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/usblp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/class/usblp.c') diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 48dee4b8d8e..292919d260a 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -813,7 +813,7 @@ static unsigned int usblp_quirks (__u16 vendor, __u16 product) return 0; } -static struct file_operations usblp_fops = { +static const struct file_operations usblp_fops = { .owner = THIS_MODULE, .read = usblp_read, .write = usblp_write, -- cgit v1.2.3 From 5bc66d530b6c158795cb3fefd2106a09afb5e0f7 Mon Sep 17 00:00:00 2001 From: "Luiz Fernando N. Capitulino" Date: Wed, 27 Sep 2006 11:58:53 -0700 Subject: USB: usblp: Use usb_endpoint_* functions. Signed-off-by: Luiz Fernando N. Capitulino Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/usblp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'drivers/usb/class/usblp.c') diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 292919d260a..9b05a359b9f 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -1021,18 +1021,13 @@ static int usblp_select_alts(struct usblp *usblp) for (e = 0; e < ifd->desc.bNumEndpoints; e++) { epd = &ifd->endpoint[e].desc; - if ((epd->bmAttributes&USB_ENDPOINT_XFERTYPE_MASK)!= - USB_ENDPOINT_XFER_BULK) - continue; - - if (!(epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK)) { + if (usb_endpoint_is_bulk_out(epd)) if (!epwrite) epwrite = epd; - } else { + if (usb_endpoint_is_bulk_in(epd)) if (!epread) epread = epd; - } } /* Ignore buggy hardware without the right endpoints. */ -- cgit v1.2.3 From 96cede531c632ac019003bf40128b1821761a164 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 28 Aug 2006 11:43:25 -0700 Subject: USB: fix __must_check warnings in drivers/usb/class/ Signed-off-by: Greg Kroah-Hartman --- drivers/usb/class/usblp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/usb/class/usblp.c') diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 9b05a359b9f..9cac11ca1bb 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -927,7 +927,9 @@ static int usblp_probe(struct usb_interface *intf, /* Retrieve and store the device ID string. */ usblp_cache_device_id_string(usblp); - device_create_file(&intf->dev, &dev_attr_ieee1284_id); + retval = device_create_file(&intf->dev, &dev_attr_ieee1284_id); + if (retval) + goto abort_intfdata; #ifdef DEBUG usblp_check_status(usblp, 0); -- cgit v1.2.3