Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: fsi: Simplify with scoped for each OF child loop

Use scoped for_each_available_child_of_node_scoped() when iterating over
device nodes to make code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20251224110240.56803-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
a014c203 8672e4b5

+2 -5
+2 -5
drivers/spi/spi-fsi.c
··· 531 531 static int fsi_spi_probe(struct device *dev) 532 532 { 533 533 int rc; 534 - struct device_node *np; 535 534 int num_controllers_registered = 0; 536 535 struct fsi2spi *bridge; 537 536 struct fsi_device *fsi = to_fsi_dev(dev); ··· 546 547 bridge->fsi = fsi; 547 548 mutex_init(&bridge->lock); 548 549 549 - for_each_available_child_of_node(dev->of_node, np) { 550 + for_each_available_child_of_node_scoped(dev->of_node, np) { 550 551 u32 base; 551 552 struct fsi_spi *ctx; 552 553 struct spi_controller *ctlr; ··· 555 556 continue; 556 557 557 558 ctlr = spi_alloc_host(dev, sizeof(*ctx)); 558 - if (!ctlr) { 559 - of_node_put(np); 559 + if (!ctlr) 560 560 break; 561 - } 562 561 563 562 ctlr->dev.of_node = np; 564 563 ctlr->num_chipselect = of_get_available_child_count(np) ?: 1;