Skip to content

Commit

Permalink
backlight: atmel-pwm-bl: fix deferred probe from __init
Browse files Browse the repository at this point in the history
Move probe out of __init section and don't use platform_driver_probe
which cannot be used with deferred probing.

Since commit e935457 ("gpiolib: Defer failed gpio requests by default")
this driver might return -EPROBE_DEFER if a gpio_request fails.

Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Sep 26, 2013
1 parent 17dab4d commit 9d3fde8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/video/backlight/atmel-pwm-bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = {
.update_status = atmel_pwm_bl_set_intensity,
};

static int __init atmel_pwm_bl_probe(struct platform_device *pdev)
static int atmel_pwm_bl_probe(struct platform_device *pdev)
{
struct backlight_properties props;
const struct atmel_pwm_bl_platform_data *pdata;
Expand Down Expand Up @@ -202,7 +202,7 @@ static int __init atmel_pwm_bl_probe(struct platform_device *pdev)
return retval;
}

static int __exit atmel_pwm_bl_remove(struct platform_device *pdev)
static int atmel_pwm_bl_remove(struct platform_device *pdev)
{
struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev);

Expand All @@ -220,10 +220,11 @@ static struct platform_driver atmel_pwm_bl_driver = {
.name = "atmel-pwm-bl",
},
/* REVISIT add suspend() and resume() */
.remove = __exit_p(atmel_pwm_bl_remove),
.probe = atmel_pwm_bl_probe,
.remove = atmel_pwm_bl_remove,
};

module_platform_driver_probe(atmel_pwm_bl_driver, atmel_pwm_bl_probe);
module_platform_driver(atmel_pwm_bl_driver);

MODULE_AUTHOR("Hans-Christian egtvedt <hans-christian.egtvedt@atmel.com>");
MODULE_DESCRIPTION("Atmel PWM backlight driver");
Expand Down

0 comments on commit 9d3fde8

Please sign in to comment.