mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
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>
This commit is contained in:
parent
8672e4b51a
commit
a014c203b5
|
|
@ -531,7 +531,6 @@ static size_t fsi_spi_max_transfer_size(struct spi_device *spi)
|
|||
static int fsi_spi_probe(struct device *dev)
|
||||
{
|
||||
int rc;
|
||||
struct device_node *np;
|
||||
int num_controllers_registered = 0;
|
||||
struct fsi2spi *bridge;
|
||||
struct fsi_device *fsi = to_fsi_dev(dev);
|
||||
|
|
@ -547,7 +546,7 @@ static int fsi_spi_probe(struct device *dev)
|
|||
bridge->fsi = fsi;
|
||||
mutex_init(&bridge->lock);
|
||||
|
||||
for_each_available_child_of_node(dev->of_node, np) {
|
||||
for_each_available_child_of_node_scoped(dev->of_node, np) {
|
||||
u32 base;
|
||||
struct fsi_spi *ctx;
|
||||
struct spi_controller *ctlr;
|
||||
|
|
@ -556,10 +555,8 @@ static int fsi_spi_probe(struct device *dev)
|
|||
continue;
|
||||
|
||||
ctlr = spi_alloc_host(dev, sizeof(*ctx));
|
||||
if (!ctlr) {
|
||||
of_node_put(np);
|
||||
if (!ctlr)
|
||||
break;
|
||||
}
|
||||
|
||||
ctlr->dev.of_node = np;
|
||||
ctlr->num_chipselect = of_get_available_child_count(np) ?: 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user