2014-10-13 20:50:45

by Felipe Balbi

[permalink] [raw]
Subject: [PATCH] pinctrl: baytrail: add missing module removal support

pinctrl-baytrail driver provides a proper ->remove()
method on its platform_driver definition, however there's
no way, currently, to unload the driver due to missing
module_exit(). This patch adds module_exit().

Signed-off-by: Felipe Balbi <[email protected]>
---
drivers/pinctrl/pinctrl-baytrail.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c
index e12e5b0..3ece001 100644
--- a/drivers/pinctrl/pinctrl-baytrail.c
+++ b/drivers/pinctrl/pinctrl-baytrail.c
@@ -612,5 +612,10 @@ static int __init byt_gpio_init(void)
{
return platform_driver_register(&byt_gpio_driver);
}
-
subsys_initcall(byt_gpio_init);
+
+static void __exit byt_gpio_exit(void)
+{
+ platform_driver_unregister(&byt_gpio_driver);
+}
+module_exit(byt_gpio_exit);
--
2.1.0.GIT


2014-10-13 20:59:05

by David Cohen

[permalink] [raw]
Subject: Re: [PATCH] pinctrl: baytrail: add missing module removal support

Hi Linus,

On Mon, Oct 13, 2014 at 03:50:08PM -0500, Felipe Balbi wrote:
> pinctrl-baytrail driver provides a proper ->remove()
> method on its platform_driver definition, however there's
> no way, currently, to unload the driver due to missing
> module_exit(). This patch adds module_exit().
>
> Signed-off-by: Felipe Balbi <[email protected]>

This is a quite trivial patch, so not sure you need an Ack from somebody
that has the actual hw. In case you do:

Acked-by: David Cohen <[email protected]>

> ---
> drivers/pinctrl/pinctrl-baytrail.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-baytrail.c b/drivers/pinctrl/pinctrl-baytrail.c
> index e12e5b0..3ece001 100644
> --- a/drivers/pinctrl/pinctrl-baytrail.c
> +++ b/drivers/pinctrl/pinctrl-baytrail.c
> @@ -612,5 +612,10 @@ static int __init byt_gpio_init(void)
> {
> return platform_driver_register(&byt_gpio_driver);
> }
> -
> subsys_initcall(byt_gpio_init);
> +
> +static void __exit byt_gpio_exit(void)
> +{
> + platform_driver_unregister(&byt_gpio_driver);
> +}
> +module_exit(byt_gpio_exit);
> --
> 2.1.0.GIT
>