Re: [PATCH DNI v3 15/15] media: rcar-fcp: Check device revision at probe time

From: Geert Uytterhoeven

Date: Tue Oct 20 2026 - 08:27:27 EST


Hi Paul,

On Thu, 15 Oct 2026 at 09:53, Paul Elder
<paul.elder+renesas@xxxxxxxxxxxxxxxx> wrote:
> From: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
>
> Verify that the device revision register reports a valid value,
> otherwise reject the device.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
> Signed-off-by: Paul Elder <paul.elder+renesas@xxxxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/media/platform/renesas/rcar-fcp.c
> +++ b/drivers/media/platform/renesas/rcar-fcp.c

> +
> +static const struct of_device_id rcar_fcp_of_match[] = {
> + { .compatible = "renesas,fcpf", .data = (void *)RCAR_FCPF },
> + { .compatible = "renesas,fcpv", .data = (void *)RCAR_FCPV },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, rcar_fcp_of_match);

I don't see a good reason for moving this around?

> +
> static int rcar_fcp_probe(struct platform_device *pdev)
> {
> struct rcar_fcp_device *fcp;
> + int ret;
>
> fcp = devm_kzalloc(&pdev->dev, sizeof(*fcp), GFP_KERNEL);
> if (fcp == NULL)
> return -ENOMEM;
>
> fcp->dev = &pdev->dev;
> + fcp->type = (enum rcar_fcp_type)device_get_match_data(&pdev->dev);

s/rcar_fcp_type/uintptr_t/, although this no longer seems to trigger
a conversion between pointer and integer of different sizes warning?

>
> platform_set_drvdata(pdev, fcp);
>

> @@ -215,13 +332,6 @@ static const struct dev_pm_ops fcp_pm_ops = {
> RUNTIME_PM_OPS(fcp_pm_runtime_suspend, fcp_pm_runtime_resume, NULL)
> };
>
> -static const struct of_device_id rcar_fcp_of_match[] = {
> - { .compatible = "renesas,fcpf" },
> - { .compatible = "renesas,fcpv" },
> - { },
> -};
> -MODULE_DEVICE_TABLE(of, rcar_fcp_of_match);
> -
> static struct platform_driver rcar_fcp_platform_driver = {
> .probe = rcar_fcp_probe,
> .remove = rcar_fcp_remove,
>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds