Skip to content

Commit

Permalink
twl4030-gpio: remove __devexit markings from remove func
Browse files Browse the repository at this point in the history
The gpio_twl4030_probe() function calls gpio_twl4030_remove(), and the
former has __devinit, so the latter cannot use __devexit.  Otherwise we
hit the section mismatch warning:

WARNING: drivers/gpio/built-in.o(.devinit.text+0x71a): Section mismatch
	in reference from the function _gpio_twl4030_probe() to the function
	.devexit.text:_gpio_twl4030_remove()
The function __devinit _gpio_twl4030_probe() references a function
	__devexit _gpio_twl4030_remove().
This is often seen when error handling in the init function uses
	functionality in the exit path.
The fix is often to remove the __devexit annotation of
	_gpio_twl4030_remove() so it may be used outside an exit section.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Mike Frysinger authored and Linus Torvalds committed Oct 29, 2009
1 parent c68d2b1 commit 46c529c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpio/twl4030-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ static int __devinit gpio_twl4030_probe(struct platform_device *pdev)
return ret;
}

static int __devexit gpio_twl4030_remove(struct platform_device *pdev)
/* Cannot use __devexit as gpio_twl4030_probe() calls us */
static int gpio_twl4030_remove(struct platform_device *pdev)
{
struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data;
int status;
Expand Down Expand Up @@ -493,7 +494,7 @@ static struct platform_driver gpio_twl4030_driver = {
.driver.name = "twl4030_gpio",
.driver.owner = THIS_MODULE,
.probe = gpio_twl4030_probe,
.remove = __devexit_p(gpio_twl4030_remove),
.remove = gpio_twl4030_remove,
};

static int __init gpio_twl4030_init(void)
Expand Down

0 comments on commit 46c529c

Please sign in to comment.