Re: [PATCH DNI v3 15/15] media: rcar-fcp: Check device revision at probe time
From: Laurent Pinchart
Date: Fri Oct 30 2026 - 18:02:45 EST
On Tue, Oct 20, 2026 at 02:20:43PM +0200, Geert Uytterhoeven wrote:
> On Thu, 15 Oct 2026 at 09:53, Paul Elder 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?
I think it's a leftover from the original version of the patch, which
was using of_match_device(). It's not needed any more now that the code
below uses device_get_match_data()/
> > +
> > 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,
> >
--
Regards,
Laurent Pinchart