* [PATCH] w1:masters/w1-gpio.c: fix error using "__devinit" and "__devexit"
@ 2012-12-11 12:08 Cong Ding
2012-12-11 19:42 ` Daniel Mack
0 siblings, 1 reply; 2+ messages in thread
From: Cong Ding @ 2012-12-11 12:08 UTC (permalink / raw)
To: Evgeniy Polyakov, Greg Kroah-Hartman, Andrew Morton, Daniel Mack,
Ville Syrjälä, linux-kernel
Cc: Cong Ding
w1:masters/w1-gpio.c: fix error using "__devinit" and "__devexit"
we should use "__devinit" to mark the probe function, "__devexit" to
mark the remove function, and "__devexit_p" to mark the pointer to the
remove function.
the error was found by the following compilation warning:
WARNING: drivers/w1/masters/w1-gpio.o(.data+0x0): Section mismatch in
reference from the variable w1_gpio_driver to the function
.init.text:w1_gpio_probe()
The variable w1_gpio_driver references
the function __init w1_gpio_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
drivers/w1/masters/w1-gpio.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index 85b363a..33edc3b 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -72,7 +72,7 @@ static int w1_gpio_probe_dt(struct platform_device *pdev)
return 0;
}
-static int __init w1_gpio_probe(struct platform_device *pdev)
+static int __devinit w1_gpio_probe(struct platform_device *pdev)
{
struct w1_bus_master *master;
struct w1_gpio_platform_data *pdata;
@@ -158,7 +158,7 @@ static int __init w1_gpio_probe(struct platform_device *pdev)
return err;
}
-static int __exit w1_gpio_remove(struct platform_device *pdev)
+static int __devexit w1_gpio_remove(struct platform_device *pdev)
{
struct w1_bus_master *master = platform_get_drvdata(pdev);
struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
@@ -210,7 +210,7 @@ static struct platform_driver w1_gpio_driver = {
.of_match_table = of_match_ptr(w1_gpio_dt_ids),
},
.probe = w1_gpio_probe,
- .remove = __exit_p(w1_gpio_remove),
+ .remove = __devexit_p(w1_gpio_remove),
.suspend = w1_gpio_suspend,
.resume = w1_gpio_resume,
};
--
1.7.4.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] w1:masters/w1-gpio.c: fix error using "__devinit" and "__devexit"
2012-12-11 12:08 [PATCH] w1:masters/w1-gpio.c: fix error using "__devinit" and "__devexit" Cong Ding
@ 2012-12-11 19:42 ` Daniel Mack
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Mack @ 2012-12-11 19:42 UTC (permalink / raw)
To: Cong Ding
Cc: Evgeniy Polyakov, Greg Kroah-Hartman, Andrew Morton,
Ville Syrjälä, linux-kernel
On 11.12.2012 13:08, Cong Ding wrote:
> w1:masters/w1-gpio.c: fix error using "__devinit" and "__devexit"
>
> we should use "__devinit" to mark the probe function, "__devexit" to
> mark the remove function, and "__devexit_p" to mark the pointer to the
> remove function.
Nope. CONFIG_HOTPLUG is going away as an option, so you should rather
kill all the __dev* annotations.
Thanks,
Daniel
> the error was found by the following compilation warning:
> WARNING: drivers/w1/masters/w1-gpio.o(.data+0x0): Section mismatch in
> reference from the variable w1_gpio_driver to the function
> .init.text:w1_gpio_probe()
> The variable w1_gpio_driver references
> the function __init w1_gpio_probe()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
> Signed-off-by: Cong Ding <dinggnu@gmail.com>
> ---
> drivers/w1/masters/w1-gpio.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
> index 85b363a..33edc3b 100644
> --- a/drivers/w1/masters/w1-gpio.c
> +++ b/drivers/w1/masters/w1-gpio.c
> @@ -72,7 +72,7 @@ static int w1_gpio_probe_dt(struct platform_device *pdev)
> return 0;
> }
>
> -static int __init w1_gpio_probe(struct platform_device *pdev)
> +static int __devinit w1_gpio_probe(struct platform_device *pdev)
> {
> struct w1_bus_master *master;
> struct w1_gpio_platform_data *pdata;
> @@ -158,7 +158,7 @@ static int __init w1_gpio_probe(struct platform_device *pdev)
> return err;
> }
>
> -static int __exit w1_gpio_remove(struct platform_device *pdev)
> +static int __devexit w1_gpio_remove(struct platform_device *pdev)
> {
> struct w1_bus_master *master = platform_get_drvdata(pdev);
> struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
> @@ -210,7 +210,7 @@ static struct platform_driver w1_gpio_driver = {
> .of_match_table = of_match_ptr(w1_gpio_dt_ids),
> },
> .probe = w1_gpio_probe,
> - .remove = __exit_p(w1_gpio_remove),
> + .remove = __devexit_p(w1_gpio_remove),
> .suspend = w1_gpio_suspend,
> .resume = w1_gpio_resume,
> };
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-11 19:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 12:08 [PATCH] w1:masters/w1-gpio.c: fix error using "__devinit" and "__devexit" Cong Ding
2012-12-11 19:42 ` Daniel Mack
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).