mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
mfd: tps6586x: Fix OF node refcount
Platform devices created with platform_device_alloc() call
platform_device_release() when the last reference to the device's
kobject is dropped. This function calls of_node_put() unconditionally.
This works fine for devices created with platform_device_register_full()
but users of the split approach (platform_device_alloc() +
platform_device_add()) must bump the reference of the of_node they
assign manually. Add the missing call to of_node_get().
Cc: [email protected]
Fixes: 62f6b08793 ("tps6586x: Add device tree support")
Signed-off-by: Bartosz Golaszewski <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Lee Jones <[email protected]>
This commit is contained in:
1 parent
28ad23ef7f
commit
3001ed2b4e
1 file changed
+1
-1
@@ -397,7 +397,7 @@ static int tps6586x_add_subdevs(struct tps6586x *tps6586x,
|
||||
|
||||
pdev->dev.parent = tps6586x->dev;
|
||||
pdev->dev.platform_data = subdev->platform_data;
|
||||
pdev->dev.of_node = subdev->of_node;
|
||||
pdev->dev.of_node = of_node_get(subdev->of_node);
|
||||
|
||||
ret = platform_device_add(pdev);
|
||||
if (ret) {
|
||||
|
||||
Reference in new issue
Block a user