From: Markus Elfring Date: Mon, 25 Jul 2016 18:29:59 +0000 (-0700) Subject: Input: synaptics-rmi4 - do not check for NULL when calling of_node_put() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=887ec0bfbd146c08e34ccb65a8f4251dc110e52f;p=openwrt%2Fstaging%2Fblogic.git Input: synaptics-rmi4 - do not check for NULL when calling of_node_put() The of_node_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c index 253df96be427..a73580654c6b 100644 --- a/drivers/input/rmi4/rmi_bus.c +++ b/drivers/input/rmi4/rmi_bus.c @@ -232,10 +232,7 @@ err_put_device: void rmi_unregister_function(struct rmi_function *fn) { device_del(&fn->dev); - - if (fn->dev.of_node) - of_node_put(fn->dev.of_node); - + of_node_put(fn->dev.of_node); put_device(&fn->dev); }