dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Anusha Srivatsa <asrivats@redhat.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	 Jessica Zhang <jessica.zhang@oss.qualcomm.com>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	 Florian Fainelli <florian.fainelli@broadcom.com>,
	 Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	 Sumit Semwal <sumit.semwal@linaro.org>,
	 Casey Connolly <casey.connolly@linaro.org>,
	 Jerry Han <hanxu5@huaqin.corp-partner.google.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	 Anusha Srivatsa <asrivats@redhat.com>
Subject: [PATCH 10/14] drm/panel/lpm102a188a: Use refcounted allocation in place of devm_kzalloc()
Date: Thu, 10 Jul 2025 23:31:21 -0500	[thread overview]
Message-ID: <20250710-b4-driver-convert-last-part-july-v1-10-de73ba81b2f5@redhat.com> (raw)
In-Reply-To: <20250710-b4-driver-convert-last-part-july-v1-0-de73ba81b2f5@redhat.com>

Move to using the new API devm_drm_panel_alloc() to allocate the
panel. In the call to the new API, avoid using explicit type and use
__typeof() for more type safety.

Signed-off-by: Anusha Srivatsa <asrivats@redhat.com>
---
 drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
index 5b5082efb282bcf705cf2d38dea24901e9803648..5f897e143758c2be51c39a20eeda2ecd09e1fbee 100644
--- a/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
+++ b/drivers/gpu/drm/panel/panel-jdi-lpm102a188a.c
@@ -435,9 +435,6 @@ static int jdi_panel_add(struct jdi_panel *jdi)
 		return dev_err_probe(dev, PTR_ERR(jdi->backlight),
 				     "failed to create backlight\n");
 
-	drm_panel_init(&jdi->base, &jdi->link1->dev, &jdi_panel_funcs,
-		       DRM_MODE_CONNECTOR_DSI);
-
 	drm_panel_add(&jdi->base);
 
 	return 0;
@@ -475,10 +472,13 @@ static int jdi_panel_dsi_probe(struct mipi_dsi_device *dsi)
 
 	/* register a panel for only the DSI-LINK1 interface */
 	if (secondary) {
-		jdi = devm_kzalloc(&dsi->dev, sizeof(*jdi), GFP_KERNEL);
-		if (!jdi) {
+		jdi = devm_drm_panel_alloc(&dsi->dev, __typeof(*jdi),
+					   base, &jdi_panel_funcs,
+					   DRM_MODE_CONNECTOR_DSI);
+
+		if (IS_ERR(jdi)) {
 			put_device(&secondary->dev);
-			return -ENOMEM;
+			return PTR_ERR(jdi);
 		}
 
 		mipi_dsi_set_drvdata(dsi, jdi);

-- 
2.48.1


  parent reply	other threads:[~2025-07-11  4:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11  4:31 [PATCH 00/14] drm/panel: Use refcounted allocation in place of devm_kzalloc() - Part5 Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 01/14] drm/panel/lq101r1sx01: Use refcounted allocation in place of devm_kzalloc() Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 02/14] drm/panel/raspberrypi: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 03/14] drm/panel/vvx10f034n00: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 04/14] drm/panel/osd101t2587-53ts: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 05/14] drm/panel/novatek-nt36672a: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 06/14] drm/panel/lg-sw43408: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 07/14] drm/panel/kd097d04: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 08/14] drm/panel/khadas-ts050: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 09/14] drm/panel/jdi-lt070me05000: " Anusha Srivatsa
2025-07-11  4:31 ` Anusha Srivatsa [this message]
2025-07-11  4:31 ` [PATCH 11/14] drm/panel/ilitek-ili9882t: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 12/14] drm/panel/himax-hx83102: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 13/14] drm/panel/boe-tv101wum-nl6: " Anusha Srivatsa
2025-07-11  4:31 ` [PATCH 14/14] drm/panel/boe-himax8279d: " Anusha Srivatsa
2025-07-16 15:37 ` [PATCH 00/14] drm/panel: Use refcounted allocation in place of devm_kzalloc() - Part5 Maxime Ripard
2025-07-17  2:09   ` Anusha Srivatsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250710-b4-driver-convert-last-part-july-v1-10-de73ba81b2f5@redhat.com \
    --to=asrivats@redhat.com \
    --cc=airlied@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=casey.connolly@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=hanxu5@huaqin.corp-partner.google.com \
    --cc=jessica.zhang@oss.qualcomm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=simona@ffwll.ch \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).