Re: [PATCH V2 1/2] soc: imx: Add SCU SoC info driver support

From: Leonard Crestez
Date: Wed May 15 2019 - 06:06:41 EST


On 15.05.2019 11:32, Anson Huang wrote:
> Add i.MX SCU SoC info driver to support i.MX8QXP SoC, introduce
> driver dependency into Kconfig as CONFIG_IMX_SCU must be
> selected to support i.MX SCU SoC driver, also need to use
> platform driver model to make sure IMX_SCU driver is probed
> before i.MX SCU SoC driver.
>
> With this patch, SoC info can be read from sysfs:

> + id = of_match_node(imx_scu_soc_match, root);
> + if (!id) {
> + of_node_put(root);
> + return -ENODEV;
> + }

Perhaps this check should be moved from imx_scu_soc_probe to
imx_scu_soc_init? As far as I can tell this "probe" function will be
attempted on all SOCs (even non-imx). Better to check if we're on a
SCU-based soc early and avoid temporary allocations.

> +module_init(imx_scu_soc_init);
> +module_exit(imx_scu_soc_exit);

Please don't make this a module

--
Regards,
Leonard