Commit d512d025 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'soundwire-6.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire

Pull soundwire fix from Vinod Koul:

 - Single fix for calling fwnode_handle_put() on the
   returned fwnode pointer

* tag 'soundwire-6.10-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire:
  soundwire: fix usages of device_get_named_child_node()
parents 50736169 e2d8ea0a
...@@ -571,6 +571,9 @@ static int sdw_master_read_amd_prop(struct sdw_bus *bus) ...@@ -571,6 +571,9 @@ static int sdw_master_read_amd_prop(struct sdw_bus *bus)
amd_manager->wake_en_mask = wake_en_mask; amd_manager->wake_en_mask = wake_en_mask;
fwnode_property_read_u32(link, "amd-sdw-power-mode", &power_mode_mask); fwnode_property_read_u32(link, "amd-sdw-power-mode", &power_mode_mask);
amd_manager->power_mode_mask = power_mode_mask; amd_manager->power_mode_mask = power_mode_mask;
fwnode_handle_put(link);
return 0; return 0;
} }
......
...@@ -155,8 +155,10 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) ...@@ -155,8 +155,10 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus)
SDW_MASTER_QUIRKS_CLEAR_INITIAL_PARITY; SDW_MASTER_QUIRKS_CLEAR_INITIAL_PARITY;
intel_prop = devm_kzalloc(bus->dev, sizeof(*intel_prop), GFP_KERNEL); intel_prop = devm_kzalloc(bus->dev, sizeof(*intel_prop), GFP_KERNEL);
if (!intel_prop) if (!intel_prop) {
fwnode_handle_put(link);
return -ENOMEM; return -ENOMEM;
}
/* initialize with hardware defaults, in case the properties are not found */ /* initialize with hardware defaults, in case the properties are not found */
intel_prop->doaise = 0x1; intel_prop->doaise = 0x1;
...@@ -184,6 +186,8 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus) ...@@ -184,6 +186,8 @@ static int sdw_master_read_intel_prop(struct sdw_bus *bus)
intel_prop->dodse, intel_prop->dodse,
intel_prop->dods); intel_prop->dods);
fwnode_handle_put(link);
return 0; return 0;
} }
......
...@@ -66,8 +66,10 @@ int sdw_master_read_prop(struct sdw_bus *bus) ...@@ -66,8 +66,10 @@ int sdw_master_read_prop(struct sdw_bus *bus)
prop->clk_freq = devm_kcalloc(bus->dev, prop->num_clk_freq, prop->clk_freq = devm_kcalloc(bus->dev, prop->num_clk_freq,
sizeof(*prop->clk_freq), sizeof(*prop->clk_freq),
GFP_KERNEL); GFP_KERNEL);
if (!prop->clk_freq) if (!prop->clk_freq) {
fwnode_handle_put(link);
return -ENOMEM; return -ENOMEM;
}
fwnode_property_read_u32_array(link, fwnode_property_read_u32_array(link,
"mipi-sdw-clock-frequencies-supported", "mipi-sdw-clock-frequencies-supported",
...@@ -92,8 +94,10 @@ int sdw_master_read_prop(struct sdw_bus *bus) ...@@ -92,8 +94,10 @@ int sdw_master_read_prop(struct sdw_bus *bus)
prop->clk_gears = devm_kcalloc(bus->dev, prop->num_clk_gears, prop->clk_gears = devm_kcalloc(bus->dev, prop->num_clk_gears,
sizeof(*prop->clk_gears), sizeof(*prop->clk_gears),
GFP_KERNEL); GFP_KERNEL);
if (!prop->clk_gears) if (!prop->clk_gears) {
fwnode_handle_put(link);
return -ENOMEM; return -ENOMEM;
}
fwnode_property_read_u32_array(link, fwnode_property_read_u32_array(link,
"mipi-sdw-supported-clock-gears", "mipi-sdw-supported-clock-gears",
...@@ -116,6 +120,8 @@ int sdw_master_read_prop(struct sdw_bus *bus) ...@@ -116,6 +120,8 @@ int sdw_master_read_prop(struct sdw_bus *bus)
fwnode_property_read_u32(link, "mipi-sdw-command-error-threshold", fwnode_property_read_u32(link, "mipi-sdw-command-error-threshold",
&prop->err_threshold); &prop->err_threshold);
fwnode_handle_put(link);
return 0; return 0;
} }
EXPORT_SYMBOL(sdw_master_read_prop); EXPORT_SYMBOL(sdw_master_read_prop);
...@@ -197,8 +203,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, ...@@ -197,8 +203,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
dpn[i].num_words, dpn[i].num_words,
sizeof(*dpn[i].words), sizeof(*dpn[i].words),
GFP_KERNEL); GFP_KERNEL);
if (!dpn[i].words) if (!dpn[i].words) {
fwnode_handle_put(node);
return -ENOMEM; return -ENOMEM;
}
fwnode_property_read_u32_array(node, fwnode_property_read_u32_array(node,
"mipi-sdw-port-wordlength-configs", "mipi-sdw-port-wordlength-configs",
...@@ -236,8 +244,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, ...@@ -236,8 +244,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
dpn[i].num_channels, dpn[i].num_channels,
sizeof(*dpn[i].channels), sizeof(*dpn[i].channels),
GFP_KERNEL); GFP_KERNEL);
if (!dpn[i].channels) if (!dpn[i].channels) {
fwnode_handle_put(node);
return -ENOMEM; return -ENOMEM;
}
fwnode_property_read_u32_array(node, fwnode_property_read_u32_array(node,
"mipi-sdw-channel-number-list", "mipi-sdw-channel-number-list",
...@@ -251,8 +261,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, ...@@ -251,8 +261,10 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
dpn[i].num_ch_combinations, dpn[i].num_ch_combinations,
sizeof(*dpn[i].ch_combinations), sizeof(*dpn[i].ch_combinations),
GFP_KERNEL); GFP_KERNEL);
if (!dpn[i].ch_combinations) if (!dpn[i].ch_combinations) {
fwnode_handle_put(node);
return -ENOMEM; return -ENOMEM;
}
fwnode_property_read_u32_array(node, fwnode_property_read_u32_array(node,
"mipi-sdw-channel-combination-list", "mipi-sdw-channel-combination-list",
...@@ -274,6 +286,8 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave, ...@@ -274,6 +286,8 @@ static int sdw_slave_read_dpn(struct sdw_slave *slave,
/* TODO: Read audio mode */ /* TODO: Read audio mode */
fwnode_handle_put(node);
i++; i++;
} }
...@@ -348,10 +362,14 @@ int sdw_slave_read_prop(struct sdw_slave *slave) ...@@ -348,10 +362,14 @@ int sdw_slave_read_prop(struct sdw_slave *slave)
prop->dp0_prop = devm_kzalloc(&slave->dev, prop->dp0_prop = devm_kzalloc(&slave->dev,
sizeof(*prop->dp0_prop), sizeof(*prop->dp0_prop),
GFP_KERNEL); GFP_KERNEL);
if (!prop->dp0_prop) if (!prop->dp0_prop) {
fwnode_handle_put(port);
return -ENOMEM; return -ENOMEM;
}
sdw_slave_read_dp0(slave, port, prop->dp0_prop); sdw_slave_read_dp0(slave, port, prop->dp0_prop);
fwnode_handle_put(port);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment