Re: [PATCH] memory: atmel-ebi: unwind SMC clock on probe failures

From: Krzysztof Kozlowski

Date: Tue Jun 30 2026 - 13:26:47 EST


On 16/06/2026 17:17, Pengpeng Hou wrote:
> reg_cells += val;
> @@ -603,11 +605,23 @@ static int atmel_ebi_probe(struct platform_device *pdev)
>
> ret = atmel_ebi_dev_disable(ebi, child);
> if (ret)
> - return ret;
> + goto err_disable_smc_clk;
> }
> }
>
> - return of_platform_populate(np, NULL, NULL, dev);
> + ret = of_platform_populate(np, NULL, NULL, dev);
> + if (ret) {
> + of_platform_depopulate(dev);

Why do we need to depopulate when populate returned with an error?

Best regards,
Krzysztof