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);
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;
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;