Instead of directly using of_node_get() before of_find_node_by_name()
to balance the refcount of the device_node, using wraper function
of_find_node_by_name_balanced() to make code logic a bit simplier.
Signed-off-by: Zhang Zekun
---
arch/powerpc/platforms/powermac/pic.c | 4 +---
1 file
Instead of directly using of_node_get() before of_find_node_by_name()
to balance the refcount of the device_node, using wraper function
of_find_node_by_name_balanced() to make code logic a bit simplier.
Signed-off-by: Zhang Zekun
---
drivers/regulator/scmi-regulator.c | 3 +--
1 file changed, 1
Instead of directly using of_node_get() before of_find_node_by_name()
to balance the refcount of the device_node, using wraper function
of_find_node_by_name_balanced() to make code logic a bit simplier.
Signed-off-by: Zhang Zekun
---
drivers/net/ethernet/marvell/prestera/prestera_main.c | 3
Instead of directly using of_node_get() before of_find_node_by_name()
to balance the refcount of the device_node, using wraper function
of_find_node_by_name_balanced() to make code logic a bit simplier.
Signed-off-by: Zhang Zekun
---
drivers/net/dsa/hirschmann/hellcreek_ptp.c | 3 +--
1 file
of_find_node_by_name() will decrease the refount of the device_node.
So, get the device_node before passing to it.
Fixes: 20e6d190ffe1 ("net: pse-pd: Add TI TPS23881 PSE controller driver")
Signed-off-by: Zhang Zekun
---
drivers/net/pse-pd/tps23881.c | 2 +-
1 file changed, 1 inser
Instead of directly using of_node_get() before of_find_node_by_name()
to balance the refcount of the device_node, using wraper function
of_find_node_by_name_balanced() to make code logic a bit simplier.
Signed-off-by: Zhang Zekun
---
drivers/media/i2c/max9286.c | 4 +---
1 file changed, 1
Instead of directly using of_node_get() before of_find_node_by_name()
to balance the refcount of the device_node, using wraper function
of_find_node_by_name_balanced() to make code logic a bit simplier.
Signed-off-by: Zhang Zekun
---
drivers/net/dsa/bcm_sf2.c | 4 +---
1 file changed, 1
Add wrapper function of_find_node_by_name_balanced() for drivers who
want to call of_find_node_by_name() and have to blance the ref count
by calling of_node_get(). For drivers who forget to call of_node_get(),
can also utilizing of_find_node_by_name_balanced() to fix a refcount
leak.
Zhang Zekun
of_find_node_by_name() will decrease the refcount of the device_node.
So, get the device_node before passing to it.
Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller")
Signed-off-by: Zhang Zekun
---
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 2 +-
1 fi
of_find_node_by_name(), drivers may use this function
to call of_find_node_by_name() with the refcount already balanced.
[1] https://lore.kernel.org/all/20241024015909.58654-1-zhangzeku...@huawei.com/
Signed-off-by: Zhang Zekun
---
include/linux/of.h | 5 +
1 file changed, 5 insertions
of_find_compatible_node() will increase the refcount of the device_node.
Decrease the refcount once finish using it.
Fixes: e95f287deed2 ("soc: fsl: handle RCPM errata A-008646 on SoC LS1021A")
Signed-off-by: Zhang Zekun
---
drivers/soc/fsl/rcpm.c | 1 +
1 file changed, 1 insertio
of_find_node_by_name() will decrease the refount of the device_node.
So, get the device_node before passing to it.
Signed-off-by: Zhang Zekun
---
arch/powerpc/platforms/chrp/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/chrp/pci.c
b/arch/powerpc/platforms
The of_property_read_u64() can fail and remain the variable uninitialized,
which will then be used. Return error if we failed to read the property.
Fixes: 2e6bd221d96f ("powerpc/kexec_file: Enable early kernel OPAL calls")
Signed-off-by: Zhang Zekun
---
arch/powerpc/kexec/file_loa
The definition of ocxl_create_cdev() and ocxl_destroy_cdev() has been
removed since commit 75ca758adbaf ("ocxl: Create a clear delineation
between ocxl backend & frontend"). So, let's remove the empty declarations.
Signed-off-by: Zhang Zekun
---
drivers/misc/ocxl/ocxl_intern
for_each_child_of_node() can help to iterate through the device_node,
and we don't need to do it manually. No functional change with this
conversion.
Signed-off-by: Zhang Zekun
---
arch/powerpc/platforms/powermac/pfunc_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --
for_each_child_of_node can help to iterate through the device_node,
and we don't need to use while loop. No functional change with this
conversion.
Signed-off-by: Zhang Zekun
---
arch/powerpc/platforms/pseries/dlpar.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a
Use for_each_child_of_node() to iterate through the device_node, this
can make code more simple.
Zhang Zekun (2):
powerpc/powermac/pfunc_base: Use helper function
for_each_child_of_node()
powerpc/pseries/dlpar: Use helper function for_each_child_of_node()
arch/powerpc/platforms/powermac
17 matches
Mail list logo