From nobody Sat Nov 30 07:44:05 2024 Received: from mx.astralinux.ru (mx.astralinux.ru [89.232.161.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B46F51990D7; Tue, 10 Sep 2024 15:17:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.232.161.68 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725981456; cv=none; b=qA53VDyvxxogNRyo9JAVqtqG7qGKkC2FlGLpsTEeM+vXDjT6RLUlMWuQPG+LLN6Mke6b8/6DB8mZwoCvAHibfRqZ6/BM0MY1N2AvZs1DFKR3GnnM0Nkpg2AMIq8DzedmHpJTuUxn46bnei/dqHPwuZgR/Np7p6+lxl/WHvjBBn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725981456; c=relaxed/simple; bh=d/RQ5sNLcYkvF4CdWxzVY2TXrgcPiorhfwWLLF79imo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EvbN49UPp7sLJY/UsRauy9SmoyRtTMRs7yPZa2kMrPAln3s7VbyPqd05+mfqXQAzwd3Gs/eEZ7Ngum1BRd8jzAY1NBhNT7hGzvt1dYqbm0ZmELkNXhXio9ZxvHs7jTn2kX8wOkC2B4Tlx0oL4DY/u+njilPMJ0H41VsNl9FLn3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru; spf=pass smtp.mailfrom=astralinux.ru; arc=none smtp.client-ip=89.232.161.68 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=astralinux.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=astralinux.ru Received: from [10.177.185.108] (helo=new-mail.astralinux.ru) by mx.astralinux.ru with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1so2aq-00Bgn3-7F; Tue, 10 Sep 2024 18:15:48 +0300 Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.14.240]) by new-mail.astralinux.ru (Postfix) with ESMTPA id 4X36kL0dQ5z1gxcZ; Tue, 10 Sep 2024 18:16:58 +0300 (MSK) From: Anastasia Belova To: Neil Armstrong Cc: Anastasia Belova , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, stable@vger.kernel.org Subject: [PATCH v2] drm/meson: switch to a managed drm device Date: Tue, 10 Sep 2024 18:16:00 +0300 Message-Id: <20240910151600.18659-1-abelova@astralinux.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-DrWeb-SpamScore: 0 X-DrWeb-SpamState: legit X-DrWeb-SpamDetail: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehuddgtddvucetufdoteggodetrfcurfhrohhfihhlvgemucfftfghgfeunecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetnhgrshhtrghsihgruceuvghlohhvrgcuoegrsggvlhhovhgrsegrshhtrhgrlhhinhhugidrrhhuqeenucggtffrrghtthgvrhhnpefhudejgfetgfeftdeitdegffduhefftdduieeludeutdffgeeugfdvgedutddtvdenucfkphepuddtrddujeejrddugedrvdegtdenucfrrghrrghmpehhvghloheprhgsthgrqdhmshhkqdhlthdquddtiedtiedvrdgrshhtrhgrlhhinhhugidrrhhupdhinhgvthepuddtrddujeejrddugedrvdegtdemfeekvddtiedpmhgrihhlfhhrohhmpegrsggvlhhovhgrsegrshhtrhgrlhhinhhugidrrhhupdhnsggprhgtphhtthhopeduiedprhgtphhtthhopehnvghilhdrrghrmhhsthhrohhngheslhhinhgrrhhordhorhhgpdhrtghpthhtoheprggsvghlohhvrgesrghsthhrrghlihhnuhigrdhruhdprhgtphhtthhopehmrggrrhhtvghnrdhlrghnkhhhohhrshhtsehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepmhhrihhprghrugeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepthiiihhmmhgvrhhmrghnnhesshhushgvrdguvgdprh gtphhtthhopegrihhrlhhivggusehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggrnhhivghlsehffhiflhhlrdgthhdprhgtphhtthhopehkhhhilhhmrghnsegsrgihlhhisghrvgdrtghomhdprhgtphhtthhopehjsghruhhnvghtsegsrgihlhhisghrvgdrtghomhdprhgtphhtthhopehmrghrthhinhdrsghluhhmvghnshhtihhnghhlsehgohhoghhlvghmrghilhdrtghomhdprhgtphhtthhopegurhhiqdguvghvvghlsehlihhsthhsrdhfrhgvvgguvghskhhtohhprdhorhhgpdhrtghpthhtoheplhhinhhugidqrghmlhhoghhitgeslhhishhtshdrihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehlihhnuhigqdgrrhhmqdhkvghrnhgvlheslhhishhtshdrihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlvhgtqdhprhhojhgvtghtsehlihhnuhigthgvshhtihhnghdrohhrghdprhgtphhtthhopehsthgrsghlvgesvhhgvghrrdhkvghrnhgvlhdrohhrghenucffrhdrhggvsgcutehnthhishhprghmmecunecuvfgrghhsme X-DrWeb-SpamVersion: Dr.Web Antispam 1.0.7.202406240#1725964328#02 X-AntiVirus: Checked by Dr.Web [MailD: 11.1.19.2307031128, SE: 11.1.12.2210241838, Core engine: 7.00.65.05230, Virus records: 12168076, Updated: 2024-Sep-10 13:36:53 UTC] Content-Type: text/plain; charset="utf-8" Switch to a managed drm device to cleanup some error handling and make future work easier. Fix dereference of NULL in meson_drv_bind_master by removing drm_dev_put(drm) before meson_encoder_*_remove and component_unbind_all where drm is dereferenced. Co-developed by Linux Verification Center (linuxtesting.org). Cc: stable@vger.kernel.org # 6.5 Fixes: 6a044642988b ("drm/meson: fix unbind path if HDMI fails to bind") Signed-off-by: Anastasia Belova --- v2: fix commit message and add Cc: stable@vger.kernel.org drivers/gpu/drm/meson/meson_crtc.c | 10 +-- drivers/gpu/drm/meson/meson_drv.c | 71 ++++++++++------------ drivers/gpu/drm/meson/meson_drv.h | 2 +- drivers/gpu/drm/meson/meson_encoder_cvbs.c | 8 +-- drivers/gpu/drm/meson/meson_overlay.c | 8 +-- drivers/gpu/drm/meson/meson_plane.c | 10 +-- 6 files changed, 51 insertions(+), 58 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_crtc.c b/drivers/gpu/drm/meson/mes= on_crtc.c index d70616da8ce2..e1c0bf3baeea 100644 --- a/drivers/gpu/drm/meson/meson_crtc.c +++ b/drivers/gpu/drm/meson/meson_crtc.c @@ -662,13 +662,13 @@ void meson_crtc_irq(struct meson_drm *priv) =20 drm_crtc_handle_vblank(priv->crtc); =20 - spin_lock_irqsave(&priv->drm->event_lock, flags); + spin_lock_irqsave(&priv->drm.event_lock, flags); if (meson_crtc->event) { drm_crtc_send_vblank_event(priv->crtc, meson_crtc->event); drm_crtc_vblank_put(priv->crtc); meson_crtc->event =3D NULL; } - spin_unlock_irqrestore(&priv->drm->event_lock, flags); + spin_unlock_irqrestore(&priv->drm.event_lock, flags); } =20 int meson_crtc_create(struct meson_drm *priv) @@ -677,18 +677,18 @@ int meson_crtc_create(struct meson_drm *priv) struct drm_crtc *crtc; int ret; =20 - meson_crtc =3D devm_kzalloc(priv->drm->dev, sizeof(*meson_crtc), + meson_crtc =3D devm_kzalloc(priv->drm.dev, sizeof(*meson_crtc), GFP_KERNEL); if (!meson_crtc) return -ENOMEM; =20 meson_crtc->priv =3D priv; crtc =3D &meson_crtc->base; - ret =3D drm_crtc_init_with_planes(priv->drm, crtc, + ret =3D drm_crtc_init_with_planes(&priv->drm, crtc, priv->primary_plane, NULL, &meson_crtc_funcs, "meson_crtc"); if (ret) { - dev_err(priv->drm->dev, "Failed to init CRTC\n"); + dev_err(priv->drm.dev, "Failed to init CRTC\n"); return ret; } =20 diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meso= n_drv.c index 4bd0baa2a4f5..2e7c2e7c7b82 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -182,7 +182,6 @@ static int meson_drv_bind_master(struct device *dev, bo= ol has_components) struct platform_device *pdev =3D to_platform_device(dev); const struct meson_drm_match_data *match; struct meson_drm *priv; - struct drm_device *drm; struct resource *res; void __iomem *regs; int ret, i; @@ -197,17 +196,13 @@ static int meson_drv_bind_master(struct device *dev, = bool has_components) if (!match) return -ENODEV; =20 - drm =3D drm_dev_alloc(&meson_driver, dev); - if (IS_ERR(drm)) - return PTR_ERR(drm); + priv =3D devm_drm_dev_alloc(dev, &meson_driver, + struct meson_drm, drm); =20 - priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); - if (!priv) { - ret =3D -ENOMEM; - goto free_drm; - } - drm->dev_private =3D priv; - priv->drm =3D drm; + if (IS_ERR(priv)) + return PTR_ERR(priv); + + priv->drm.dev_private =3D priv; priv->dev =3D dev; priv->compat =3D match->compat; priv->afbcd.ops =3D match->afbcd_ops; @@ -215,7 +210,7 @@ static int meson_drv_bind_master(struct device *dev, bo= ol has_components) regs =3D devm_platform_ioremap_resource_byname(pdev, "vpu"); if (IS_ERR(regs)) { ret =3D PTR_ERR(regs); - goto free_drm; + goto remove_encoders; } =20 priv->io_base =3D regs; @@ -223,13 +218,13 @@ static int meson_drv_bind_master(struct device *dev, = bool has_components) res =3D platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi"); if (!res) { ret =3D -EINVAL; - goto free_drm; + goto remove_encoders; } /* Simply ioremap since it may be a shared register zone */ regs =3D devm_ioremap(dev, res->start, resource_size(res)); if (!regs) { ret =3D -EADDRNOTAVAIL; - goto free_drm; + goto remove_encoders; } =20 priv->hhi =3D devm_regmap_init_mmio(dev, regs, @@ -237,18 +232,18 @@ static int meson_drv_bind_master(struct device *dev, = bool has_components) if (IS_ERR(priv->hhi)) { dev_err(&pdev->dev, "Couldn't create the HHI regmap\n"); ret =3D PTR_ERR(priv->hhi); - goto free_drm; + goto remove_encoders; } =20 priv->canvas =3D meson_canvas_get(dev); if (IS_ERR(priv->canvas)) { ret =3D PTR_ERR(priv->canvas); - goto free_drm; + goto remove_encoders; } =20 ret =3D meson_canvas_alloc(priv->canvas, &priv->canvas_id_osd1); if (ret) - goto free_drm; + goto remove_encoders; ret =3D meson_canvas_alloc(priv->canvas, &priv->canvas_id_vd1_0); if (ret) goto free_canvas_osd1; @@ -261,7 +256,7 @@ static int meson_drv_bind_master(struct device *dev, bo= ol has_components) =20 priv->vsync_irq =3D platform_get_irq(pdev, 0); =20 - ret =3D drm_vblank_init(drm, 1); + ret =3D drm_vblank_init(&priv->drm, 1); if (ret) goto free_canvas_vd1_2; =20 @@ -284,10 +279,10 @@ static int meson_drv_bind_master(struct device *dev, = bool has_components) ret =3D drmm_mode_config_init(drm); if (ret) goto free_canvas_vd1_2; - drm->mode_config.max_width =3D 3840; - drm->mode_config.max_height =3D 2160; - drm->mode_config.funcs =3D &meson_mode_config_funcs; - drm->mode_config.helper_private =3D &meson_mode_config_helpers; + priv->drm.mode_config.max_width =3D 3840; + priv->drm.mode_config.max_height =3D 2160; + priv->drm.mode_config.funcs =3D &meson_mode_config_funcs; + priv->drm.mode_config.helper_private =3D &meson_mode_config_helpers; =20 /* Hardware Initialization */ =20 @@ -308,9 +303,9 @@ static int meson_drv_bind_master(struct device *dev, bo= ol has_components) goto exit_afbcd; =20 if (has_components) { - ret =3D component_bind_all(dev, drm); + ret =3D component_bind_all(dev, &priv->drm); if (ret) { - dev_err(drm->dev, "Couldn't bind all components\n"); + dev_err(priv->drm.dev, "Couldn't bind all components\n"); /* Do not try to unbind */ has_components =3D false; goto exit_afbcd; @@ -339,26 +334,26 @@ static int meson_drv_bind_master(struct device *dev, = bool has_components) if (ret) goto exit_afbcd; =20 - ret =3D request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm= ); + ret =3D request_irq(priv->vsync_irq, meson_irq, 0, priv->drm.driver->name= , &priv->drm); if (ret) goto exit_afbcd; =20 - drm_mode_config_reset(drm); + drm_mode_config_reset(&priv->drm); =20 - drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_init(&priv->drm); =20 platform_set_drvdata(pdev, priv); =20 - ret =3D drm_dev_register(drm, 0); + ret =3D drm_dev_register(&priv->drm, 0); if (ret) goto uninstall_irq; =20 - drm_fbdev_dma_setup(drm, 32); + drm_fbdev_dma_setup(&priv->drm, 32); =20 return 0; =20 uninstall_irq: - free_irq(priv->vsync_irq, drm); + free_irq(priv->vsync_irq, &priv->drm); exit_afbcd: if (priv->afbcd.ops) priv->afbcd.ops->exit(priv); @@ -370,15 +365,14 @@ static int meson_drv_bind_master(struct device *dev, = bool has_components) meson_canvas_free(priv->canvas, priv->canvas_id_vd1_0); free_canvas_osd1: meson_canvas_free(priv->canvas, priv->canvas_id_osd1); -free_drm: - drm_dev_put(drm); +remove_encoders: =20 meson_encoder_dsi_remove(priv); meson_encoder_hdmi_remove(priv); meson_encoder_cvbs_remove(priv); =20 if (has_components) - component_unbind_all(dev, drm); + component_unbind_all(dev, &priv->drm); =20 return ret; } @@ -391,7 +385,7 @@ static int meson_drv_bind(struct device *dev) static void meson_drv_unbind(struct device *dev) { struct meson_drm *priv =3D dev_get_drvdata(dev); - struct drm_device *drm =3D priv->drm; + struct drm_device *drm =3D &priv->drm; =20 if (priv->canvas) { meson_canvas_free(priv->canvas, priv->canvas_id_osd1); @@ -404,7 +398,6 @@ static void meson_drv_unbind(struct device *dev) drm_kms_helper_poll_fini(drm); drm_atomic_helper_shutdown(drm); free_irq(priv->vsync_irq, drm); - drm_dev_put(drm); =20 meson_encoder_dsi_remove(priv); meson_encoder_hdmi_remove(priv); @@ -428,7 +421,7 @@ static int __maybe_unused meson_drv_pm_suspend(struct d= evice *dev) if (!priv) return 0; =20 - return drm_mode_config_helper_suspend(priv->drm); + return drm_mode_config_helper_suspend(&priv->drm); } =20 static int __maybe_unused meson_drv_pm_resume(struct device *dev) @@ -445,7 +438,7 @@ static int __maybe_unused meson_drv_pm_resume(struct de= vice *dev) if (priv->afbcd.ops) priv->afbcd.ops->init(priv); =20 - return drm_mode_config_helper_resume(priv->drm); + return drm_mode_config_helper_resume(&priv->drm); } =20 static void meson_drv_shutdown(struct platform_device *pdev) @@ -455,8 +448,8 @@ static void meson_drv_shutdown(struct platform_device *= pdev) if (!priv) return; =20 - drm_kms_helper_poll_fini(priv->drm); - drm_atomic_helper_shutdown(priv->drm); + drm_kms_helper_poll_fini(&priv->drm); + drm_atomic_helper_shutdown(&priv->drm); } =20 /* diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meso= n_drv.h index 3f9345c14f31..c4c6c810cb20 100644 --- a/drivers/gpu/drm/meson/meson_drv.h +++ b/drivers/gpu/drm/meson/meson_drv.h @@ -53,7 +53,7 @@ struct meson_drm { u8 canvas_id_vd1_1; u8 canvas_id_vd1_2; =20 - struct drm_device *drm; + struct drm_device drm; struct drm_crtc *crtc; struct drm_plane *primary_plane; struct drm_plane *overlay_plane; diff --git a/drivers/gpu/drm/meson/meson_encoder_cvbs.c b/drivers/gpu/drm/m= eson/meson_encoder_cvbs.c index d1191de855d9..ddca22c8c1ff 100644 --- a/drivers/gpu/drm/meson/meson_encoder_cvbs.c +++ b/drivers/gpu/drm/meson/meson_encoder_cvbs.c @@ -104,7 +104,7 @@ static int meson_encoder_cvbs_get_modes(struct drm_brid= ge *bridge, for (i =3D 0; i < MESON_CVBS_MODES_COUNT; ++i) { struct meson_cvbs_mode *meson_mode =3D &meson_cvbs_modes[i]; =20 - mode =3D drm_mode_duplicate(priv->drm, &meson_mode->mode); + mode =3D drm_mode_duplicate(&priv->drm, &meson_mode->mode); if (!mode) { dev_err(priv->dev, "Failed to create a new display mode\n"); return 0; @@ -221,7 +221,7 @@ static const struct drm_bridge_funcs meson_encoder_cvbs= _bridge_funcs =3D { =20 int meson_encoder_cvbs_probe(struct meson_drm *priv) { - struct drm_device *drm =3D priv->drm; + struct drm_device *drm =3D &priv->drm; struct meson_encoder_cvbs *meson_encoder_cvbs; struct drm_connector *connector; struct device_node *remote; @@ -256,7 +256,7 @@ int meson_encoder_cvbs_probe(struct meson_drm *priv) meson_encoder_cvbs->priv =3D priv; =20 /* Encoder */ - ret =3D drm_simple_encoder_init(priv->drm, &meson_encoder_cvbs->encoder, + ret =3D drm_simple_encoder_init(&priv->drm, &meson_encoder_cvbs->encoder, DRM_MODE_ENCODER_TVDAC); if (ret) return dev_err_probe(priv->dev, ret, @@ -273,7 +273,7 @@ int meson_encoder_cvbs_probe(struct meson_drm *priv) } =20 /* Initialize & attach Bridge Connector */ - connector =3D drm_bridge_connector_init(priv->drm, &meson_encoder_cvbs->e= ncoder); + connector =3D drm_bridge_connector_init(&priv->drm, &meson_encoder_cvbs->= encoder); if (IS_ERR(connector)) return dev_err_probe(priv->dev, PTR_ERR(connector), "Unable to create CVBS bridge connector\n"); diff --git a/drivers/gpu/drm/meson/meson_overlay.c b/drivers/gpu/drm/meson/= meson_overlay.c index 7f98de38842b..60ee7f758723 100644 --- a/drivers/gpu/drm/meson/meson_overlay.c +++ b/drivers/gpu/drm/meson/meson_overlay.c @@ -484,7 +484,7 @@ static void meson_overlay_atomic_update(struct drm_plan= e *plane, =20 interlace_mode =3D new_state->crtc->mode.flags & DRM_MODE_FLAG_INTERLACE; =20 - spin_lock_irqsave(&priv->drm->event_lock, flags); + spin_lock_irqsave(&priv->drm.event_lock, flags); =20 if ((fb->modifier & DRM_FORMAT_MOD_AMLOGIC_FBC(0, 0)) =3D=3D DRM_FORMAT_MOD_AMLOGIC_FBC(0, 0)) { @@ -717,7 +717,7 @@ static void meson_overlay_atomic_update(struct drm_plan= e *plane, =20 priv->viu.vd1_enabled =3D true; =20 - spin_unlock_irqrestore(&priv->drm->event_lock, flags); + spin_unlock_irqrestore(&priv->drm.event_lock, flags); =20 DRM_DEBUG_DRIVER("\n"); } @@ -838,7 +838,7 @@ int meson_overlay_create(struct meson_drm *priv) =20 DRM_DEBUG_DRIVER("\n"); =20 - meson_overlay =3D devm_kzalloc(priv->drm->dev, sizeof(*meson_overlay), + meson_overlay =3D devm_kzalloc(priv->drm.dev, sizeof(*meson_overlay), GFP_KERNEL); if (!meson_overlay) return -ENOMEM; @@ -846,7 +846,7 @@ int meson_overlay_create(struct meson_drm *priv) meson_overlay->priv =3D priv; plane =3D &meson_overlay->base; =20 - drm_universal_plane_init(priv->drm, plane, 0xFF, + drm_universal_plane_init(&priv->drm, plane, 0xFF, &meson_overlay_funcs, supported_drm_formats, ARRAY_SIZE(supported_drm_formats), diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/me= son_plane.c index b43ac61201f3..13be94309bf4 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -157,7 +157,7 @@ static void meson_plane_atomic_update(struct drm_plane = *plane, * Update Buffer * Enable Plane */ - spin_lock_irqsave(&priv->drm->event_lock, flags); + spin_lock_irqsave(&priv->drm.event_lock, flags); =20 /* Check if AFBC decoder is required for this buffer */ if ((meson_vpu_is_compatible(priv, VPU_COMPATIBLE_GXM) || @@ -393,7 +393,7 @@ static void meson_plane_atomic_update(struct drm_plane = *plane, =20 priv->viu.osd1_enabled =3D true; =20 - spin_unlock_irqrestore(&priv->drm->event_lock, flags); + spin_unlock_irqrestore(&priv->drm.event_lock, flags); } =20 static void meson_plane_atomic_disable(struct drm_plane *plane, @@ -536,7 +536,7 @@ int meson_plane_create(struct meson_drm *priv) const uint64_t *format_modifiers =3D format_modifiers_default; int ret; =20 - meson_plane =3D devm_kzalloc(priv->drm->dev, sizeof(*meson_plane), + meson_plane =3D devm_kzalloc(priv->drm.dev, sizeof(*meson_plane), GFP_KERNEL); if (!meson_plane) return -ENOMEM; @@ -549,14 +549,14 @@ int meson_plane_create(struct meson_drm *priv) else if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) format_modifiers =3D format_modifiers_afbc_g12a; =20 - ret =3D drm_universal_plane_init(priv->drm, plane, 0xFF, + ret =3D drm_universal_plane_init(&priv->drm, plane, 0xFF, &meson_plane_funcs, supported_drm_formats, ARRAY_SIZE(supported_drm_formats), format_modifiers, DRM_PLANE_TYPE_PRIMARY, "meson_primary_plane"); if (ret) { - devm_kfree(priv->drm->dev, meson_plane); + devm_kfree(priv->drm.dev, meson_plane); return ret; } =20 --=20 2.30.2