linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: gpio-keys - use module_platform_driver macro
@ 2016-10-27 14:15 Slawomir Stepien
  2016-10-27 16:48 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Slawomir Stepien @ 2016-10-27 14:15 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: ldewangan, linux-input, linux-kernel, kernel-janitors

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);
-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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: gpio-keys - use module_platform_driver macro
  2016-10-27 14:15 [PATCH] Input: gpio-keys - use module_platform_driver macro Slawomir Stepien
@ 2016-10-27 16:48 ` Dmitry Torokhov
  2016-10-27 19:11   ` Slawomir Stepien
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2016-10-27 16:48 UTC (permalink / raw)
  To: Slawomir Stepien; +Cc: ldewangan, linux-input, linux-kernel, kernel-janitors

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: gpio-keys - use module_platform_driver macro
  2016-10-27 16:48 ` Dmitry Torokhov
@ 2016-10-27 19:11   ` Slawomir Stepien
  0 siblings, 0 replies; 3+ messages in thread
From: Slawomir Stepien @ 2016-10-27 19:11 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: ldewangan, linux-input, linux-kernel, kernel-janitors

On Oct 27, 2016 09:48, Dmitry Torokhov wrote:
> Hi Slawomir,

Hi Dmitry,

> > -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.

I was unaware of that. Let me look in to that more deeply. At the moment I do
not have the knowledge what will be to correct solution for that.

> > -module_exit(gpio_keys_exit);
> > +module_platform_driver(gpio_keys_device_driver);
> >  
> >  MODULE_LICENSE("GPL");
> >  MODULE_AUTHOR("Phil Blundell <pb@handhelds.org>");
> 
> Thanks.

Thank you.

-- 
Slawomir Stepien

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-27 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-27 14:15 [PATCH] Input: gpio-keys - use module_platform_driver macro Slawomir Stepien
2016-10-27 16:48 ` Dmitry Torokhov
2016-10-27 19:11   ` Slawomir Stepien

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).