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

Marek Vasut marex at denx.de
Mon Feb 27 07:55:18 PST 2023


On 2/24/23 14:09, Lucas Stach wrote:
> Am Freitag, dem 24.02.2023 um 13:08 +0100 schrieb Marek Vasut:
>> On 2/24/23 10:08, Lucas Stach wrote:
>>
>> Hi,
>>
>>>> diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c
>>>> index 399cb85105a18..77e7dc4eb8cff 100644
>>>> --- a/drivers/soc/imx/imx8m-blk-ctrl.c
>>>> +++ b/drivers/soc/imx/imx8m-blk-ctrl.c
>>>> @@ -310,7 +310,7 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev)
>>>>    
>>>>    	dev_set_drvdata(dev, bc);
>>>>    
>>>> -	return 0;
>>>> +	return devm_of_platform_populate(dev);
>>>
>>> You need to handle the return value, not simply pass it through as the
>>> return value of the probe function. When devm_of_platform_populate
>>> fails you miss to clean up the genpd provider and detach from the power
>>> domains.
>>
>> Hmmm, but then I cannot use the devm_ variant, can I ?
> 
> Why not? If everything works okay the devm will just take care of
> cleaning up the platform devices when the blk-ctrl is removed. If it
> fails you just need to roll back the non-devm parts of the blk-ctrl
> probe routine.

All right, I just sent a V5. Thanks for the clarification.



More information about the linux-arm-kernel mailing list