aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-11-06 10:48:46 -0500
committerSebastian Reichel <sre@kernel.org>2015-12-04 20:04:03 -0500
commitb7e16ec6e3d2ea0b62cf93a0e849db55f403a871 (patch)
treef05d08a51e7823607898b35372656d9a48e99653
parent31ade3b83e1821da5fbb2f11b5b3d4ab2ec39db8 (diff)
power: bq2415x_charger: Delete unnecessary checks before the function call "of_node_put"
The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the calls is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r--drivers/power/bq2415x_charger.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/power/bq2415x_charger.c b/drivers/power/bq2415x_charger.c
index 4afd76848bce..27e89536689a 100644
--- a/drivers/power/bq2415x_charger.c
+++ b/drivers/power/bq2415x_charger.c
@@ -1704,7 +1704,7 @@ error_4:
1704error_3: 1704error_3:
1705 bq2415x_power_supply_exit(bq); 1705 bq2415x_power_supply_exit(bq);
1706error_2: 1706error_2:
1707 if (bq && bq->notify_node) 1707 if (bq)
1708 of_node_put(bq->notify_node); 1708 of_node_put(bq->notify_node);
1709 kfree(name); 1709 kfree(name);
1710error_1: 1710error_1:
@@ -1724,9 +1724,7 @@ static int bq2415x_remove(struct i2c_client *client)
1724 if (bq->nb.notifier_call) 1724 if (bq->nb.notifier_call)
1725 power_supply_unreg_notifier(&bq->nb); 1725 power_supply_unreg_notifier(&bq->nb);
1726 1726
1727 if (bq->notify_node) 1727 of_node_put(bq->notify_node);
1728 of_node_put(bq->notify_node);
1729
1730 bq2415x_sysfs_exit(bq); 1728 bq2415x_sysfs_exit(bq);
1731 bq2415x_power_supply_exit(bq); 1729 bq2415x_power_supply_exit(bq);
1732 1730