Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1510481

Re: [PATCH] Input: gpio-keys - use module_platform_driver macro

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Input: gpio-keys - use module_platform_driver macro
Date 2016-10-27 18:50 +0200
Message-ID <swW2l-4oW-19@gated-at.bofh.it> (permalink)
References <swU0z-38X-69@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Input: gpio-keys - use module_platform_driver macro Slawomir Stepien <sst@poczta.fm> - 2016-10-27 16:40 +0200
  Re: [PATCH] Input: gpio-keys - use module_platform_driver macro Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-27 18:50 +0200
    Re: [PATCH] Input: gpio-keys - use module_platform_driver macro Slawomir Stepien <sst@poczta.fm> - 2016-10-27 21:20 +0200

csiph-web