Messages in this thread | | | Date | Tue, 22 Nov 2011 10:23:06 +0100 | Subject | Re: [PATCH TRIVIAL 1/5] Input: keyboard: use macro module_platform_driver() | From | Linus Walleij <> |
| |
On Tue, Nov 22, 2011 at 10:00 AM, JJ Ding <jj_ding@emc.com.tw> wrote:
> Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to > save some platform_driver boilerplate code. Use it. > > Signed-off-by: JJ Ding <dgdunix@gmail.com> (...) > diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c > index fcdec5e..6c4828f 100644 > --- a/drivers/input/keyboard/nomadik-ske-keypad.c > +++ b/drivers/input/keyboard/nomadik-ske-keypad.c > @@ -390,18 +390,7 @@ struct platform_driver ske_keypad_driver = { > .probe = ske_keypad_probe, > .remove = __devexit_p(ske_keypad_remove), > }; > - > -static int __init ske_keypad_init(void) > -{ > - return platform_driver_probe(&ske_keypad_driver, ske_keypad_probe); > -} > -module_init(ske_keypad_init); > - > -static void __exit ske_keypad_exit(void) > -{ > - platform_driver_unregister(&ske_keypad_driver); > -} > -module_exit(ske_keypad_exit); > +module_platform_driver(ske_keypad_driver); > > MODULE_LICENSE("GPL v2"); > MODULE_AUTHOR("Naveen Kumar <naveen.gaddipati@stericsson.com> / Sundar Iyer <sundar.iyer@stericsson.com>");
This actually also fixes a bug since platform_driver_probe() was used even though there is a .probe member in the driver struct, so thanks.
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |