Re: [PATCH v2 2/5] mfd: qcom-spmi-pmic: use devm_mfd_add_devices instead of devm_of_platform_populate
From: Stephen Boyd
Date: Mon Jan 07 2019 - 16:41:34 EST
Quoting Brian Masney (2019-01-06 18:11:42)
> + },
> + {
> + .name = "pm8941-regulators",
> + .of_compatible = "qcom,pm8941-regulators",
> + },
> +};
> +
> static int pmic_spmi_probe(struct spmi_device *sdev)
> {
> struct regmap *regmap;
> @@ -136,7 +191,9 @@ static int pmic_spmi_probe(struct spmi_device *sdev)
> if (sdev->usid % 2 == 0)
> pmic_spmi_show_revid(regmap, &sdev->dev);
>
> - return devm_of_platform_populate(&sdev->dev);
> + return devm_mfd_add_devices(&sdev->dev, PLATFORM_DEVID_AUTO,
> + pmic_spmi_cells,
> + ARRAY_SIZE(pmic_spmi_cells), NULL, 0, NULL);
Now this seems worse. We have gotten by without having to explicitly
list all the devices that are inside the PMIC as mfd cells. But now, to
avoid creating the irqs before the hierarchy is installed, we have to
undo all of that and rely on the difference in behavior of
of_platform_populate() and mfd_add_devices(). That's pretty obscure to
figure out.
I'd prefer we drop this patch and keep disassociating virqs and
reassociating them in the gpio driver. Then we can remove the interrupts
properties in all the DTS files and finally remove the disassociate and
reassociating code in the gpio driver when all the DT files are cleaned
up. It makes things less confusing that way and doesn't require updates
to this driver.