diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-02-20 09:28:15 (GMT) |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-04-08 15:25:23 (GMT) |
commit | bf5ea28a985f274446c5fd42f170c62eeb97ad67 (patch) | |
tree | 2931be10a0ff3a391c1b8b9675aed330f3fcae9c /drivers/mfd/lm3533-core.c | |
parent | 85529575b67c318e296ae183cc80617d79aea23b (diff) | |
download | linux-bf5ea28a985f274446c5fd42f170c62eeb97ad67.tar.xz |
mfd: lm3533: Use devm_gpio_request_one()
Use devm_gpio_request_one() to make cleanup paths more simple.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/lm3533-core.c')
-rw-r--r-- | drivers/mfd/lm3533-core.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c index ceebf2c..4b7e6da 100644 --- a/drivers/mfd/lm3533-core.c +++ b/drivers/mfd/lm3533-core.c @@ -496,8 +496,8 @@ static int lm3533_device_init(struct lm3533 *lm3533) dev_set_drvdata(lm3533->dev, lm3533); if (gpio_is_valid(lm3533->gpio_hwen)) { - ret = gpio_request_one(lm3533->gpio_hwen, GPIOF_OUT_INIT_LOW, - "lm3533-hwen"); + ret = devm_gpio_request_one(lm3533->dev, lm3533->gpio_hwen, + GPIOF_OUT_INIT_LOW, "lm3533-hwen"); if (ret < 0) { dev_err(lm3533->dev, "failed to request HWEN GPIO %d\n", @@ -528,8 +528,6 @@ err_unregister: mfd_remove_devices(lm3533->dev); err_disable: lm3533_disable(lm3533); - if (gpio_is_valid(lm3533->gpio_hwen)) - gpio_free(lm3533->gpio_hwen); return ret; } @@ -542,8 +540,6 @@ static void lm3533_device_exit(struct lm3533 *lm3533) mfd_remove_devices(lm3533->dev); lm3533_disable(lm3533); - if (gpio_is_valid(lm3533->gpio_hwen)) - gpio_free(lm3533->gpio_hwen); } static bool lm3533_readable_register(struct device *dev, unsigned int reg) |