All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: integrator: fix integrator_cpufreq_remove return type
@ 2014-09-26 20:19 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2014-09-26 20:19 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rafael J. Wysocki, Linus Walleij, Russell King, linux-arm-kernel,
	linux-pm

When building this driver as a module, we get a helpful warning
about the return type:

drivers/cpufreq/integrator-cpufreq.c:232:2: warning: initialization from incompatible pointer type
  .remove = __exit_p(integrator_cpufreq_remove),

If the remove callback returns void, the caller gets an undefined
value as it expects an integer to be returned. This fixes the
problem by passing down the value from cpufreq_unregister_driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Found while testing the integrator multiplatform patches from Linus Walleij,
this shows up as a new warning in allmodconfig.

diff --git a/drivers/cpufreq/integrator-cpufreq.c b/drivers/cpufreq/integrator-cpufreq.c
index c1320528b9d0..6bd69adc3c5e 100644
--- a/drivers/cpufreq/integrator-cpufreq.c
+++ b/drivers/cpufreq/integrator-cpufreq.c
@@ -213,9 +213,9 @@ static int __init integrator_cpufreq_probe(struct platform_device *pdev)
 	return cpufreq_register_driver(&integrator_driver);
 }
 
-static void __exit integrator_cpufreq_remove(struct platform_device *pdev)
+static int __exit integrator_cpufreq_remove(struct platform_device *pdev)
 {
-	cpufreq_unregister_driver(&integrator_driver);
+	return cpufreq_unregister_driver(&integrator_driver);
 }
 
 static const struct of_device_id integrator_cpufreq_match[] = {


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

* [PATCH] cpufreq: integrator: fix integrator_cpufreq_remove return type
@ 2014-09-26 20:19 ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2014-09-26 20:19 UTC (permalink / raw)
  To: linux-arm-kernel

When building this driver as a module, we get a helpful warning
about the return type:

drivers/cpufreq/integrator-cpufreq.c:232:2: warning: initialization from incompatible pointer type
  .remove = __exit_p(integrator_cpufreq_remove),

If the remove callback returns void, the caller gets an undefined
value as it expects an integer to be returned. This fixes the
problem by passing down the value from cpufreq_unregister_driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Found while testing the integrator multiplatform patches from Linus Walleij,
this shows up as a new warning in allmodconfig.

diff --git a/drivers/cpufreq/integrator-cpufreq.c b/drivers/cpufreq/integrator-cpufreq.c
index c1320528b9d0..6bd69adc3c5e 100644
--- a/drivers/cpufreq/integrator-cpufreq.c
+++ b/drivers/cpufreq/integrator-cpufreq.c
@@ -213,9 +213,9 @@ static int __init integrator_cpufreq_probe(struct platform_device *pdev)
 	return cpufreq_register_driver(&integrator_driver);
 }
 
-static void __exit integrator_cpufreq_remove(struct platform_device *pdev)
+static int __exit integrator_cpufreq_remove(struct platform_device *pdev)
 {
-	cpufreq_unregister_driver(&integrator_driver);
+	return cpufreq_unregister_driver(&integrator_driver);
 }
 
 static const struct of_device_id integrator_cpufreq_match[] = {

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

* Re: [PATCH] cpufreq: integrator: fix integrator_cpufreq_remove return type
  2014-09-26 20:19 ` Arnd Bergmann
@ 2014-10-02  8:28   ` Linus Walleij
  -1 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-10-02  8:28 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Viresh Kumar, Rafael J. Wysocki, Russell King, linux-arm-kernel,
	linux-pm

On Fri, Sep 26, 2014 at 10:19 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> When building this driver as a module, we get a helpful warning
> about the return type:
>
> drivers/cpufreq/integrator-cpufreq.c:232:2: warning: initialization from incompatible pointer type
>   .remove = __exit_p(integrator_cpufreq_remove),
>
> If the remove callback returns void, the caller gets an undefined
> value as it expects an integer to be returned. This fixes the
> problem by passing down the value from cpufreq_unregister_driver.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* [PATCH] cpufreq: integrator: fix integrator_cpufreq_remove return type
@ 2014-10-02  8:28   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2014-10-02  8:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Sep 26, 2014 at 10:19 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> When building this driver as a module, we get a helpful warning
> about the return type:
>
> drivers/cpufreq/integrator-cpufreq.c:232:2: warning: initialization from incompatible pointer type
>   .remove = __exit_p(integrator_cpufreq_remove),
>
> If the remove callback returns void, the caller gets an undefined
> value as it expects an integer to be returned. This fixes the
> problem by passing down the value from cpufreq_unregister_driver.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2014-10-02  8:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-26 20:19 [PATCH] cpufreq: integrator: fix integrator_cpufreq_remove return type Arnd Bergmann
2014-09-26 20:19 ` Arnd Bergmann
2014-10-02  8:28 ` Linus Walleij
2014-10-02  8:28   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.