From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Slawomir Stepien <sst@poczta.fm>
Cc: ldewangan@nvidia.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] Input: gpio-keys - use module_platform_driver macro
Date: Thu, 27 Oct 2016 09:48:30 -0700 [thread overview]
Message-ID: <20161027164830.GB36933@dtor-ws> (raw)
In-Reply-To: <20161027141554.GA31977@x220.localdomain>
Hi Slawomir,
On Thu, Oct 27, 2016 at 04:15:54PM +0200, Slawomir Stepien wrote:
> The gpio_keys_init() and gpio_keys_exit() are not doing anything
> more then just register and unregister. Replace these functions with
> module_platform_driver.
>
> Signed-off-by: Slawomir Stepien <sst@poczta.fm>
> ---
> drivers/input/keyboard/gpio_keys.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 2909365..e54b586 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -877,18 +877,7 @@ static struct platform_driver gpio_keys_device_driver = {
> }
> };
>
> -static int __init gpio_keys_init(void)
> -{
> - return platform_driver_register(&gpio_keys_device_driver);
> -}
> -
> -static void __exit gpio_keys_exit(void)
> -{
> - platform_driver_unregister(&gpio_keys_device_driver);
> -}
> -
> -late_initcall(gpio_keys_init);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Because of this we can't switch to module_platform_driver(). The
late_initcall was requirement of one of platforms because of the probe
ordering issues. It may be resolved now with deferred probing, but you'd
need to confirm with all the users.
> -module_exit(gpio_keys_exit);
> +module_platform_driver(gpio_keys_device_driver);
>
> MODULE_LICENSE("GPL");
> MODULE_AUTHOR("Phil Blundell <pb@handhelds.org>");
> --
> 2.10.0
Thanks.
--
Dmitry
next prev parent reply other threads:[~2016-10-27 16:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 14:15 [PATCH] Input: gpio-keys - use module_platform_driver macro Slawomir Stepien
2016-10-27 16:48 ` Dmitry Torokhov [this message]
2016-10-27 19:11 ` Slawomir Stepien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161027164830.GB36933@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=ldewangan@nvidia.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sst@poczta.fm \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).