Skip to content

Commit 887ec0b

Browse files
elfringdtor
authored andcommitted
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 <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 8f97f8e commit 887ec0b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/input/rmi4/rmi_bus.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,7 @@ int rmi_register_function(struct rmi_function *fn)
232232
void rmi_unregister_function(struct rmi_function *fn)
233233
{
234234
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);
239236
put_device(&fn->dev);
240237
}
241238

0 commit comments

Comments
 (0)