Hi Laurent,
On Wed, Aug 14, 2019 at 4:55 PM Laurent Pinchart
<[email protected]> wrote:
> This helps identifying the IP core version, for debugging purpose only
> for now.
>
> Signed-off-by: Laurent Pinchart <[email protected]>
> --- a/drivers/media/platform/rcar-fcp.c
> +++ b/drivers/media/platform/rcar-fcp.c
> @@ -138,6 +167,18 @@ static int rcar_fcp_probe(struct platform_device *pdev)
>
> pm_runtime_enable(&pdev->dev);
>
> + fcp->iomem = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(fcp->iomem))
> + return PTR_ERR(fcp->iomem);
> +
> + pm_runtime_get_sync(&pdev->dev);
> + version = rcar_fcp_read(fcp, FCP_VCR);
> + pm_runtime_put(&pdev->dev);
Unless (dynamic) debugging is enabled, all of the above is done for obtaining
a version number that is not used.
Can this be improved?
> +
> + dev_dbg(&pdev->dev, "FCP category %u revision %u\n",
> + (version & FCP_VCR_CATEGORY_MASK) >> FCP_VCR_CATEGORY_SHIFT,
> + (version & FCP_VCR_REVISION_MASK) >> FCP_VCR_REVISION_SHIFT);
> +
> mutex_lock(&fcp_lock);
> list_add_tail(&fcp->list, &fcp_devices);
> mutex_unlock(&fcp_lock);
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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