lkml.org 
[lkml]   [2011]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] drivercore: Add helper macro for platform_driver boilerplate
On Tue, Oct 04, 2011 at 05:26:55PM -0600, Grant Likely wrote:

> +/* Helper macro for drivers that don't do anything special in module
> + * init/exit. This eliminates a lot of boilerplate */
> +#define module_platform_driver(__platform_driver) \
> +int __platform_driver##_init(void) \
> +{ \
> + return platform_driver_register(&(__platform_driver)); \
> +} \
> +module_init(__platform_driver##_init); \

This looks great but I would prefer it if the function complained if
something goes wrong - it makes problems a lot more discoverable when
they crop up.


\
 
 \ /
  Last update: 2011-10-05 12:05    [W:0.881 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site