[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <78c18978-5c25-4931-8532-b7f7895d5a34@app.fastmail.com>
Date: Fri, 02 Jan 2026 10:34:33 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Vladimir Zapolskiy" <vz@...ia.com>
Cc: "Piotr Wojtaszczyk" <piotr.wojtaszczyk@...esys.com>,
"Krzysztof Kozlowski" <krzk@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] soc: nxp: Add a simple NXP LPC32xx socinfo driver
On Fri, Jan 2, 2026, at 00:56, Vladimir Zapolskiy wrote:
> Add NXP LPC32xx specific driver to get unique SoC ID from System Control
> Block registers and export it to userspace.
>
> Signed-off-by: Vladimir Zapolskiy <vz@...ia.com>
This looks fine to me overall
> +static int lpc32xx_soc_probe(struct platform_device *pdev)
> +{
> + struct soc_device_attribute *soc_dev_attr;
> + struct device *dev = &pdev->dev;
> + struct soc_device *soc_dev;
> + struct regmap *scb;
> + u32 serial_id[4];
> + int ret;
> +
> + soc_dev_attr = devm_kzalloc(dev, sizeof(*soc_dev_attr), GFP_KERNEL);
> + if (!soc_dev_attr)
> + return -ENOMEM;
> +
> + soc_dev_attr->family = "NXP LPC32xx";
> +
> + ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine);
> + if (ret)
> + return ret;
> +
> + scb = syscon_regmap_lookup_by_compatible("nxp,lpc3220-scb");
It seems a bit odd to register a fake platform_device and then
get the registers from another device.
I think with the current iteration of syscon since 26769582bf35
("mfd: syscon: Remove the platform driver support"), you should be
able to just register the driver as a module_platform_driver
for the "nxp,lpc3220-scb" compatible value. Have you tried that?
If for some reason that doesn't work, I would drop the custom
platform_device here and just merge the probe function into
the module init.
Arnd
Powered by blists - more mailing lists