[PATCH v15 3/5] drm: renesas: Add RZ/G2L DU Support
Maxime Ripard
mripard at kernel.org
Wed Dec 13 15:48:23 UTC 2023
On Wed, Dec 13, 2023 at 04:47:09PM +0100, Maxime Ripard wrote:
> On Tue, Nov 28, 2023 at 10:51:27AM +0000, Biju Das wrote:
> > +int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
> > + unsigned int crtcs)
> > +{
> > + struct rzg2l_du_device *rcdu = vsp->dev;
> > + struct platform_device *pdev;
> > + unsigned int num_crtcs = hweight32(crtcs);
> > + unsigned int num_planes = 2;
> > + unsigned int i;
> > + int ret;
> > +
> > + /* Find the VSP device and initialize it. */
> > + pdev = of_find_device_by_node(np);
> > + if (!pdev)
> > + return -ENXIO;
> > +
> > + vsp->vsp = &pdev->dev;
> > +
> > + ret = drmm_add_action_or_reset(&rcdu->ddev, rzg2l_du_vsp_cleanup, vsp);
> > + if (ret < 0)
> > + return ret;
> > +
> > + ret = vsp1_du_init(vsp->vsp);
> > + if (ret < 0)
> > + return ret;
> > +
> > + vsp->planes = kcalloc(num_planes, sizeof(*vsp->planes), GFP_KERNEL);
> > + if (!vsp->planes)
> > + return -ENOMEM;
>
> drmm_kcalloc or drmm_kmalloc_array
Also, it doesn't look like you're using that array anywhere once the
action is gone.
Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20231213/8edb3af9/attachment-0001.sig>
More information about the dri-devel
mailing list