diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2015-05-18 22:45:07 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-05-23 20:03:42 +0200 |
commit | 9f6cd98fc3c64ebcebf63c04f16246f79bcc4c70 (patch) | |
tree | 96e10c579bd7564657ddb66d5f1977574c0548e2 /drivers | |
parent | a34c0a8bf8caae7a82de08dbcca2c7c11907c805 (diff) |
power: reset: ltc2952: use _optional variant of devm_gpiod_get
devm_gpiod_get_optional returns NULL if devm_gpiod_get would return an
ENOENT error pointer.
There is no semantic change intended.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/reset/ltc2952-poweroff.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/power/reset/ltc2952-poweroff.c b/drivers/power/reset/ltc2952-poweroff.c index 1e08195551fe..62c91acd6584 100644 --- a/drivers/power/reset/ltc2952-poweroff.c +++ b/drivers/power/reset/ltc2952-poweroff.c @@ -202,16 +202,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; } |