mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
clk: lmk04832: Simplify with scoped for each OF child loop
Use scoped for-each loop when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
8f0b4cce44
commit
47231ba4cb
1 changed files with 1 additions and 3 deletions
|
|
@ -1400,7 +1400,6 @@ static int lmk04832_probe(struct spi_device *spi)
|
|||
{
|
||||
const struct lmk04832_device_info *info;
|
||||
int rdbk_pin = RDBK_CLKIN_SEL1;
|
||||
struct device_node *child;
|
||||
struct lmk04832 *lmk;
|
||||
u8 tmp[3];
|
||||
int ret;
|
||||
|
|
@ -1462,14 +1461,13 @@ static int lmk04832_probe(struct spi_device *spi)
|
|||
device_property_read_u32(lmk->dev, "ti,sysref-pulse-count",
|
||||
&lmk->sysref_pulse_cnt);
|
||||
|
||||
for_each_child_of_node(lmk->dev->of_node, child) {
|
||||
for_each_child_of_node_scoped(lmk->dev->of_node, child) {
|
||||
int reg;
|
||||
|
||||
ret = of_property_read_u32(child, "reg", ®);
|
||||
if (ret) {
|
||||
dev_err(lmk->dev, "missing reg property in child: %s\n",
|
||||
child->full_name);
|
||||
of_node_put(child);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue