Skip to content

Commit 21dcd49

Browse files
committed
Merge patch series "pinctrl: intel: platform: fix error path in device_for_each_child_node()"
Javier Carrasco <javier.carrasco.cruz@gmail.com> says: This series fixes an error path where the reference of a child node is not decremented upon early return. When at it, a trivial comma/semicolon substitution I found by chance has been added to improve code clarity. Link: https://lore.kernel.org/r/20240926-intel-pinctrl-platform-scoped-v1-0-5ee4c936eea3@gmail.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2 parents 9852d85 + d594de8 commit 21dcd49

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/pinctrl/intel/pinctrl-intel-platform.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev,
9090
struct intel_community *community,
9191
struct intel_platform_pins *pins)
9292
{
93-
struct fwnode_handle *child;
9493
struct intel_padgroup *gpps;
9594
unsigned int group;
9695
size_t ngpps;
@@ -131,7 +130,7 @@ static int intel_platform_pinctrl_prepare_community(struct device *dev,
131130
return -ENOMEM;
132131

133132
group = 0;
134-
device_for_each_child_node(dev, child) {
133+
device_for_each_child_node_scoped(dev, child) {
135134
struct intel_padgroup *gpp = &gpps[group];
136135

137136
gpp->reg_num = group;
@@ -159,7 +158,7 @@ static int intel_platform_pinctrl_prepare_soc_data(struct device *dev,
159158
int ret;
160159

161160
/* Version 1.0 of the specification assumes only a single community per device node */
162-
ncommunities = 1,
161+
ncommunities = 1;
163162
communities = devm_kcalloc(dev, ncommunities, sizeof(*communities), GFP_KERNEL);
164163
if (!communities)
165164
return -ENOMEM;

0 commit comments

Comments
 (0)