Re: [PATCH v3 3/4] soc: imx: imx8m-blk-ctrl: Scan subnodes and bind drivers to them

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Dienstag, dem 21.02.2023 um 19:57 +0100 schrieb Marek Vasut:
> On 2/21/23 18:09, Lucas Stach wrote:
> 
> [...]
> 
> > > @@ -310,6 +312,13 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
> > >   
> > >   	dev_set_drvdata(dev, bc);
> > >   
> > > +	for_each_child_of_node(dev->of_node, np) {
> > > +		child = of_platform_device_create(np, NULL, dev);
> > > +		if (child)
> > > +			continue;
> > > +		dev_warn(dev, "failed to create device for %pOF\n", np);
> > > +	}
> > 
> > Any reason for not using devm_of_platform_populate() instead?
> 
> Yes, lack of awareness of that option.
> 
> Do I read it right that this gets rid of the whole loop implementation 
> here and replaces it with single function call ?

That's right. And it will also do the necessary
of_platform_device_destroy() to clean things up when the parent device
is removed.

Regards,
Lucas



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux