Re: [PATCH 1/5] drivercore: Generalize module_platform_driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux