lkml.org 
[lkml]   [2011]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] Staging: hv: mousevsc: Use the KBUILD_MODNAME macro
On Fri, Oct 28, 2011 at 06:02:22PM -0500, H Hartley Sweeten wrote:
> On Friday, October 28, 2011 3:11 PM, K. Y. Srinivasan wrote:
> >
> > Use the KBUILD_MODNAME macro.
> >
> > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
> > ---
> > drivers/staging/hv/hv_mouse.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
> > index c22f729..2c2e1b4 100644
> > --- a/drivers/staging/hv/hv_mouse.c
> > +++ b/drivers/staging/hv/hv_mouse.c
> > @@ -578,7 +578,7 @@ static const struct hv_vmbus_device_id id_table[] = {
> > MODULE_DEVICE_TABLE(vmbus, id_table);
> >
> > static struct hv_driver mousevsc_drv = {
> > - .name = "mousevsc",
> > + .name = KBUILD_MODNAME,
> > .id_table = id_table,
> > .probe = mousevsc_probe,
> > .remove = mousevsc_remove,
>
> It's just my opinion, but I'm not sure this is better.
>
> By changing the name to KBUILD_MODNAME you can no longer grep the source to
> find the driver based on it's name:

That's fine.

> $ grep -r name * | grep mousevsc
> drivers/staging/hv/hv_mouse.c: .name = "mousevsc",
>
> Also, doesn't this change the name of the driver from "mousevsc" to "hv_mouse"?

Yes.

> Does anything else need modified to handle the name change or is the matching
> handled strictly by the id_table?

No, this only shows up in sysfs, no other changes needed.

thanks,

greg k-h


\
 
 \ /
  Last update: 2011-11-27 10:29    [W:0.104 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site