lkml.org 
[lkml]   [2012]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] drivercore: Generalize module_platform_driver
On Fri, Jan 13, 2012 at 10:07:19AM +0100, Guennadi Liakhovetski wrote:
> I didn't find this patch either in "next" or in Greg's "driver-core"
> trees, so, couldn't generate a patch and had to comment here:

It's in Linus's tree now.

> > +/**
> > + * module_driver() - Helper macro for drivers that don't do anything
> > + * special in module init/exit. This eliminates a lot of boilerplate.
> > + * Each module may only use this macro once, and calling it replaces
> > + * module_init() and module_exit().
> > + * Use this macro to construct bus specific macros for registering
> > + * drivers.
> > + */
> > +#define module_driver(__driver, __register, __unregister) \
> > +static int __init __driver##_init(void) \
> > +{ \
> > + return __register(&(__driver)); \
> > +} \
> > +module_init(__driver##_init); \
> > +static void __exit __driver##_exit(void) \
> > +{ \
> > + __unregister(&(__driver)); \
> > +} \
> > +module_exit(__driver##_exit);
>
> Shall we maybe remove the trailing semicolon above?

Sure, but either way it doesn't really matter.

Care to send a fix-up patch that I can apply for 3.4?

thanks,

greg k-h


\
 
 \ /
  Last update: 2012-01-13 19:31    [W:0.097 / U:1.060 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site