Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <elfring@users.sourceforge.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Markus Elfring and committed by
Dmitry Torokhov
887ec0bf 8f97f8e5

+1 -4
+1 -4
drivers/input/rmi4/rmi_bus.c
··· 232 232 void rmi_unregister_function(struct rmi_function *fn) 233 233 { 234 234 device_del(&fn->dev); 235 - 236 - if (fn->dev.of_node) 237 - of_node_put(fn->dev.of_node); 238 - 235 + of_node_put(fn->dev.of_node); 239 236 put_device(&fn->dev); 240 237 } 241 238