Skip to content

Commit

Permalink
driver core: don't initialize 'parent' in device_add()
Browse files Browse the repository at this point in the history
'parent' is always overwritten before getting used and there is no need
to initialize it with NULL.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Viresh Kumar authored and Greg Kroah-Hartman committed Apr 8, 2017
1 parent 0dd8911 commit 35dbf4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ int device_private_init(struct device *dev)
*/
int device_add(struct device *dev)
{
struct device *parent = NULL;
struct device *parent;
struct kobject *kobj;
struct class_interface *class_intf;
int error = -EINVAL;
Expand Down

0 comments on commit 35dbf4e

Please sign in to comment.