lkml.org 
[lkml]   [2012]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 6/7] usb: core: reuse kbasename()
From
On Tue, Oct 2, 2012 at 6:00 PM, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> --- a/drivers/usb/core/file.c
> +++ b/drivers/usb/core/file.c

> @@ -200,14 +200,9 @@ int usb_register_dev(struct usb_interface *intf,
>
> /* create a usb class device for this usb interface */
> snprintf(name, sizeof(name), class_driver->name, minor - minor_base);
> - temp = strrchr(name, '/');
> - if (temp && (temp[1] != '\0'))
I have checked current linux-next, the drivers define .name in the
usb_class_driver structure as '...%d'.
So, what is the reason to check for trailing '/' here? Historical
reasons or there is a (broken/3rd party/etc) driver with it?

> - ++temp;
> - else
> - temp = name;
> intf->usb_dev = device_create(usb_class->class, &intf->dev,
> MKDEV(USB_MAJOR, minor), class_driver,
> - "%s", temp);
> + "%s", kbasename(name));



--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2012-10-03 11:21    [W:0.159 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site