diff options
Diffstat (limited to 'drivers/power/reset')
-rw-r--r-- | drivers/power/reset/at91-reset.c | 2 | ||||
-rw-r--r-- | drivers/power/reset/gpio-poweroff.c | 25 | ||||
-rw-r--r-- | drivers/power/reset/gpio-restart.c | 2 | ||||
-rw-r--r-- | drivers/power/reset/ltc2952-poweroff.c | 8 | ||||
-rw-r--r-- | drivers/power/reset/syscon-reboot.c | 2 |
5 files changed, 14 insertions, 25 deletions
diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c index ca461ebc7..36dc52fb2 100644 --- a/drivers/power/reset/at91-reset.c +++ b/drivers/power/reset/at91-reset.c @@ -243,7 +243,7 @@ static int at91_reset_probe(struct platform_device *pdev) return 0; } -static struct platform_device_id at91_reset_plat_match[] = { +static const struct platform_device_id at91_reset_plat_match[] = { { "at91-sam9260-reset", (unsigned long)at91sam9260_restart }, { "at91-sam9g45-reset", (unsigned long)at91sam9g45_restart }, { /* sentinel */ } diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c index e5332f1db..be3d81ff5 100644 --- a/drivers/power/reset/gpio-poweroff.c +++ b/drivers/power/reset/gpio-poweroff.c @@ -48,6 +48,7 @@ static void gpio_poweroff_do_poweroff(void) static int gpio_poweroff_probe(struct platform_device *pdev) { bool input = false; + enum gpiod_flags flags; /* If a pm_power_off function has already been added, leave it alone */ if (pm_power_off != NULL) { @@ -57,25 +58,15 @@ static int gpio_poweroff_probe(struct platform_device *pdev) return -EBUSY; } - reset_gpio = devm_gpiod_get(&pdev->dev, NULL); - if (IS_ERR(reset_gpio)) - return PTR_ERR(reset_gpio); - input = of_property_read_bool(pdev->dev.of_node, "input"); + if (input) + flags = GPIOD_IN; + else + flags = GPIOD_OUT_LOW; - if (input) { - if (gpiod_direction_input(reset_gpio)) { - dev_err(&pdev->dev, - "Could not set direction of reset GPIO to input\n"); - return -ENODEV; - } - } else { - if (gpiod_direction_output(reset_gpio, 0)) { - dev_err(&pdev->dev, - "Could not set direction of reset GPIO\n"); - return -ENODEV; - } - } + reset_gpio = devm_gpiod_get(&pdev->dev, NULL, flags); + if (IS_ERR(reset_gpio)) + return PTR_ERR(reset_gpio); pm_power_off = &gpio_poweroff_do_poweroff; return 0; diff --git a/drivers/power/reset/gpio-restart.c b/drivers/power/reset/gpio-restart.c index edb327efe..829b45f42 100644 --- a/drivers/power/reset/gpio-restart.c +++ b/drivers/power/reset/gpio-restart.c @@ -78,7 +78,7 @@ static int gpio_restart_probe(struct platform_device *pdev) } gpio_restart->restart_handler.notifier_call = gpio_restart_notify; - gpio_restart->restart_handler.priority = 128; + gpio_restart->restart_handler.priority = 129; gpio_restart->active_delay_ms = 100; gpio_restart->inactive_delay_ms = 100; gpio_restart->wait_delay_ms = 3000; diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c index 1e0819555..15fed9d8f 100644 --- a/drivers/power/reset/ltc2952-poweroff.c +++ b/drivers/power/reset/ltc2952-poweroff.c @@ -158,7 +158,6 @@ static irqreturn_t ltc2952_poweroff_handler(int irq, void *dev_id) HRTIMER_MODE_REL); } else { hrtimer_cancel(&data->timer_trigger); - /* omitting return value check, timer should have been valid */ } return IRQ_HANDLED; } @@ -202,16 +201,15 @@ static int ltc2952_poweroff_init(struct platform_device *pdev) return ret; } - data->gpio_trigger = devm_gpiod_get(&pdev->dev, "trigger", GPIOD_IN); + data->gpio_trigger = devm_gpiod_get_optional(&pdev->dev, "trigger", + GPIOD_IN); if (IS_ERR(data->gpio_trigger)) { /* * It's not a problem if the trigger gpio isn't available, but * it is worth a warning if its use was defined in the device * tree. */ - if (PTR_ERR(data->gpio_trigger) != -ENOENT) - dev_err(&pdev->dev, - "unable to claim gpio \"trigger\"\n"); + dev_err(&pdev->dev, "unable to claim gpio \"trigger\"\n"); data->gpio_trigger = NULL; } diff --git a/drivers/power/reset/syscon-reboot.c b/drivers/power/reset/syscon-reboot.c index d3c7d245a..7d0d269a0 100644 --- a/drivers/power/reset/syscon-reboot.c +++ b/drivers/power/reset/syscon-reboot.c @@ -88,4 +88,4 @@ static struct platform_driver syscon_reboot_driver = { .of_match_table = syscon_reboot_of_match, }, }; -module_platform_driver(syscon_reboot_driver); +builtin_platform_driver(syscon_reboot_driver); |