Re: [PATCH 2/3] nvmem: s32g-ocotp: Add driver for S32G OCOTP

From: Krzysztof Kozlowski
Date: Sun Aug 17 2025 - 01:52:26 EST


On 16/08/2025 12:47, Ciprian Costea wrote:
> Provide access to the On Chip One-Time Programmable Controller (OCOTP)
> pages on the NXP S32G platform.
>
> Signed-off-by: Ciprian Costea <ciprianmarian.costea@xxxxxxx>
> Co-developed-by: Ghennadi Procopciuc <ghennadi.procopciuc@xxxxxxx>
> Co-developed-by: Larisa Grigore <larisa.grigore@xxxxxxx>

Incomplete chain, missing SoBs. You cannot add someone's Co-developed-by
if they do not sign the patch.

> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> drivers/nvmem/Kconfig | 10 ++
> drivers/nvmem/Makefile | 2 +
> drivers/nvmem/s32g-ocotp-nvmem.c | 171 +++++++++++++++++++++++++++++++
> 3 files changed, 183 insertions(+)
> create mode 100644 drivers/nvmem/s32g-ocotp-nvmem.c
>
> diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig




> +
> +static int s32g_ocotp_probe(struct platform_device *pdev)
> +{
> + const struct of_device_id *of_matched_dt_id;
> + struct s32g_ocotp_priv *s32g_data;
> + struct device *dev = &pdev->dev;
> + struct nvmem_device *nvmem;
> + struct resource *res;
> +
> + of_matched_dt_id = of_match_device(ocotp_of_match, dev);
> + if (!of_matched_dt_id) {

This is useless check, drop everything around of_matched_dt_id.

> + dev_err(dev, "Unable to find driver data.\n");
> + return -ENODEV;
> + }
> +
> + s32g_data = devm_kzalloc(dev, sizeof(*s32g_data), GFP_KERNEL);
> + if (!s32g_data)
> + return -ENOMEM;
> +
> + s32g_data->fuse = of_device_get_match_data(dev);
> + if (!s32g_data->fuse) {
> + dev_err(dev, "Cannot find platform device data.\n");

This is impossible condition, so no need for error message.

> + return -ENODEV;

And here probably -EINVAL, because if it was probed, the device is there.

> + }
Best regards,
Krzysztof