提交 b7e16ec6 编写于 作者: M Markus Elfring 提交者: Sebastian Reichel

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: NMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: NPali Rohár <pali.rohar@gmail.com>
Signed-off-by: NSebastian Reichel <sre@kernel.org>
上级 31ade3b8
......@@ -1704,7 +1704,7 @@ static int bq2415x_probe(struct i2c_client *client,
error_3:
bq2415x_power_supply_exit(bq);
error_2:
if (bq && bq->notify_node)
if (bq)
of_node_put(bq->notify_node);
kfree(name);
error_1:
......@@ -1724,9 +1724,7 @@ static int bq2415x_remove(struct i2c_client *client)
if (bq->nb.notifier_call)
power_supply_unreg_notifier(&bq->nb);
if (bq->notify_node)
of_node_put(bq->notify_node);
of_node_put(bq->notify_node);
bq2415x_sysfs_exit(bq);
bq2415x_power_supply_exit(bq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册