diff options
author | Andreas Dannenberg <dannenberg@ti.com> | 2015-09-29 01:33:52 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-09-29 17:48:28 +0300 |
commit | 3b84b8efef054ba59e7679d1d430afb437aa4640 (patch) | |
tree | 4923b9d78abd0871a273579da87908ee285b5493 /drivers/power/bq24257_charger.c | |
parent | dfc602524b9f4ecc6de9a3050667412176db7c55 (diff) | |
download | linux-3b84b8efef054ba59e7679d1d430afb437aa4640.tar.xz |
power: bq24257: Simplify bq24257_power_supply_init()
Eliminate a few lines of code by using the PTR_ERR_OR_ZERO() macro.
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/bq24257_charger.c')
-rw-r--r-- | drivers/power/bq24257_charger.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/power/bq24257_charger.c b/drivers/power/bq24257_charger.c index 6757b4180972..060f754b41e5 100644 --- a/drivers/power/bq24257_charger.c +++ b/drivers/power/bq24257_charger.c @@ -594,10 +594,7 @@ static int bq24257_power_supply_init(struct bq24257_device *bq) &bq24257_power_supply_desc, &psy_cfg); - if (IS_ERR(bq->charger)) - return PTR_ERR(bq->charger); - - return 0; + return PTR_ERR_OR_ZERO(bq->charger); } static int bq24257_pg_gpio_probe(struct bq24257_device *bq) |