Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95b5daf5 authored by Laurentiu Tudor's avatar Laurentiu Tudor Committed by Greg Kroah-Hartman
Browse files

staging: fsl-mc: fix device ref counting



Drop unneeded get_device() call at device creation
and, as per documentation, drop reference count
after using device_find_child() return.

Signed-off-by: default avatarLaurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: default avatarStuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e724ba3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
		child_dev = fsl_mc_device_lookup(obj_desc, mc_bus_dev);
		if (child_dev) {
			check_plugged_state_change(child_dev, obj_desc);
			put_device(&child_dev->dev);
			continue;
		}

+0 −1
Original line number Diff line number Diff line
@@ -537,7 +537,6 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc,
		goto error_cleanup_dev;
	}

	(void)get_device(&mc_dev->dev);
	dev_dbg(parent_dev, "added %s\n", dev_name(&mc_dev->dev));

	*new_mc_dev = mc_dev;