diff mbox

[11/12] pinctrl: samsung: use __devinit section for init code

Message ID 1348868177-21205-12-git-send-email-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann Sept. 28, 2012, 9:36 p.m. UTC
The samsung pinctrl driver has a probe function that is
__devinit and that calls a lot of other functions that are
marked __init, which kbuild complains about.

Marking everything __devinit means that the code does not
discarded when CONFIG_HOTPLUG is set, which is a little
more wasteful, but also more consistent

Without this patch, building exynos_defconfig results in:

WARNING: drivers/pinctrl/built-in.o(.devinit.text+0x124): Section mismatch in reference from the function samsung_pinctrl_probe() to the function .init.text:samsung_gpiolib_register()
The function __devinit samsung_pinctrl_probe() references
a function __init samsung_gpiolib_register().
If samsung_gpiolib_register is only used by samsung_pinctrl_probe then
annotate samsung_gpiolib_register with a matching annotation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Kukjin Kim <kgene.kim@samsung.com>
---
 drivers/pinctrl/pinctrl-samsung.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Linus Walleij Oct. 1, 2012, 6:15 a.m. UTC | #1
On Fri, Sep 28, 2012 at 11:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> The samsung pinctrl driver has a probe function that is
> __devinit and that calls a lot of other functions that are
> marked __init, which kbuild complains about.
>
> Marking everything __devinit means that the code does not
> discarded when CONFIG_HOTPLUG is set, which is a little
> more wasteful, but also more consistent
>
> Without this patch, building exynos_defconfig results in:
>
> WARNING: drivers/pinctrl/built-in.o(.devinit.text+0x124): Section mismatch in reference from the function samsung_pinctrl_probe() to the function .init.text:samsung_gpiolib_register()
> The function __devinit samsung_pinctrl_probe() references
> a function __init samsung_gpiolib_register().
> If samsung_gpiolib_register is only used by samsung_pinctrl_probe then
> annotate samsung_gpiolib_register with a matching annotation.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Thomas Abraham <thomas.abraham@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Kukjin Kim <kgene.kim@samsung.com>

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

I think the Samsing pinctrl driver has landed into next from some
branch in ARM SoC so you probably know better than me
where this thing should be merged...

Yours,
Linus Walleij
Arnd Bergmann Oct. 2, 2012, 11:52 a.m. UTC | #2
On Monday 01 October 2012, Linus Walleij wrote:
> On Fri, Sep 28, 2012 at 11:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
> > The samsung pinctrl driver has a probe function that is
> > __devinit and that calls a lot of other functions that are
> > marked __init, which kbuild complains about.
> >
> > Marking everything __devinit means that the code does not
> > discarded when CONFIG_HOTPLUG is set, which is a little
> > more wasteful, but also more consistent
> >
> > Without this patch, building exynos_defconfig results in:
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> I think the Samsing pinctrl driver has landed into next from some
> branch in ARM SoC so you probably know better than me
> where this thing should be merged...
> 

Sorry, I was too late for this one. Can you pick it up now that the
driver is merged?

	Arnd
Linus Walleij Oct. 2, 2012, 12:57 p.m. UTC | #3
On Tue, Oct 2, 2012 at 1:52 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Monday 01 October 2012, Linus Walleij wrote:
>> On Fri, Sep 28, 2012 at 11:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>>
>> > The samsung pinctrl driver has a probe function that is
>> > __devinit and that calls a lot of other functions that are
>> > marked __init, which kbuild complains about.
>> >
>> > Marking everything __devinit means that the code does not
>> > discarded when CONFIG_HOTPLUG is set, which is a little
>> > more wasteful, but also more consistent
>> >
>> > Without this patch, building exynos_defconfig results in:
>>
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>>
>> I think the Samsing pinctrl driver has landed into next from some
>> branch in ARM SoC so you probably know better than me
>> where this thing should be merged...
>>
>
> Sorry, I was too late for this one. Can you pick it up now that the
> driver is merged?

Sure I've queued it for my -rc fixes.

Thanks,
Linus Walleij
Thierry Reding Oct. 2, 2012, 8:28 p.m. UTC | #4
On Fri, Sep 28, 2012 at 11:36:16PM +0200, Arnd Bergmann wrote:
> The samsung pinctrl driver has a probe function that is
> __devinit and that calls a lot of other functions that are
> marked __init, which kbuild complains about.
> 
> Marking everything __devinit means that the code does not
> discarded when CONFIG_HOTPLUG is set, which is a little
> more wasteful, but also more consistent
> 
> Without this patch, building exynos_defconfig results in:
> 
> WARNING: drivers/pinctrl/built-in.o(.devinit.text+0x124): Section mismatch in reference from the function samsung_pinctrl_probe() to the function .init.text:samsung_gpiolib_register()
> The function __devinit samsung_pinctrl_probe() references
> a function __init samsung_gpiolib_register().
> If samsung_gpiolib_register is only used by samsung_pinctrl_probe then
> annotate samsung_gpiolib_register with a matching annotation.

Note that work is underway to remove HOTPLUG altogether (see commit
45f035a, "CONFIG_HOTPLUG should be always on" in linux-next), so it
may make more sense to just drop the __init markings.

Thierry
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c
index dd108a9..861cd5f 100644
--- a/drivers/pinctrl/pinctrl-samsung.c
+++ b/drivers/pinctrl/pinctrl-samsung.c
@@ -513,7 +513,7 @@  static int samsung_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
  * Parse the pin names listed in the 'samsung,pins' property and convert it
  * into a list of gpio numbers are create a pin group from it.
  */
-static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
+static int __devinit samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
 			struct device_node *cfg_np, struct pinctrl_desc *pctl,
 			unsigned int **pin_list, unsigned int *npins)
 {
@@ -560,7 +560,7 @@  static int __init samsung_pinctrl_parse_dt_pins(struct platform_device *pdev,
  * from device node of the pin-controller. A pin group is formed with all
  * the pins listed in the "samsung,pins" property.
  */
-static int __init samsung_pinctrl_parse_dt(struct platform_device *pdev,
+static int __devinit samsung_pinctrl_parse_dt(struct platform_device *pdev,
 				struct samsung_pinctrl_drv_data *drvdata)
 {
 	struct device *dev = &pdev->dev;
@@ -655,7 +655,7 @@  static int __init samsung_pinctrl_parse_dt(struct platform_device *pdev,
 }
 
 /* register the pinctrl interface with the pinctrl subsystem */
-static int __init samsung_pinctrl_register(struct platform_device *pdev,
+static int __devinit samsung_pinctrl_register(struct platform_device *pdev,
 				struct samsung_pinctrl_drv_data *drvdata)
 {
 	struct pinctrl_desc *ctrldesc = &drvdata->pctl;
@@ -729,7 +729,7 @@  static int __init samsung_pinctrl_register(struct platform_device *pdev,
 }
 
 /* register the gpiolib interface with the gpiolib subsystem */
-static int __init samsung_gpiolib_register(struct platform_device *pdev,
+static int __devinit samsung_gpiolib_register(struct platform_device *pdev,
 				struct samsung_pinctrl_drv_data *drvdata)
 {
 	struct gpio_chip *gc;
@@ -762,7 +762,7 @@  static int __init samsung_gpiolib_register(struct platform_device *pdev,
 }
 
 /* unregister the gpiolib interface with the gpiolib subsystem */
-static int __init samsung_gpiolib_unregister(struct platform_device *pdev,
+static int __devinit samsung_gpiolib_unregister(struct platform_device *pdev,
 				struct samsung_pinctrl_drv_data *drvdata)
 {
 	int ret = gpiochip_remove(drvdata->gc);