From patchwork Wed Apr 2 15:23:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anusha Srivatsa X-Patchwork-Id: 14036223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB40CC28B20 for ; Wed, 2 Apr 2025 16:26:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18FA810E83D; Wed, 2 Apr 2025 16:26:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="jAfkaT+F"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1FB410E839 for ; Wed, 2 Apr 2025 16:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743611164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XI0Eq14BuE4/8eJYlUv7+De6XInkB4iwHReVJBrWt3Y=; b=jAfkaT+Ft9cSUE1JrTMnq9X6Cfhz/eBRui54qgKU5Wwzv9Vq1T/Wem3r0UYESteJXCrLsu haUiXAb/xmdSTD8upGbNr3SR/W7PRlWrKxiKNbAQuU4kRUDbEiHiVlTiujd0+uW/lgtapm 919s8iNjyEJk1QDmaI/j8uFcYij54dc= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-608-d38nRIqfPYKkJ8OiA63XOQ-1; Wed, 02 Apr 2025 12:25:58 -0400 X-MC-Unique: d38nRIqfPYKkJ8OiA63XOQ-1 X-Mimecast-MFC-AGG-ID: d38nRIqfPYKkJ8OiA63XOQ_1743611154 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 64345180025C; Wed, 2 Apr 2025 16:25:54 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.30]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 197F9195609D; Wed, 2 Apr 2025 16:25:49 +0000 (UTC) From: Anusha Srivatsa Date: Wed, 02 Apr 2025 11:23:43 -0400 Subject: [PATCH 05/30] panel/himax-hx8394: Use refcounted allocation in place of devm_kzalloc() MIME-Version: 1.0 Message-Id: <20250402-b4-drm_panel_mass_convert_part2-v1-5-903b70999ea6@redhat.com> References: <20250402-b4-drm_panel_mass_convert_part2-v1-0-903b70999ea6@redhat.com> In-Reply-To: <20250402-b4-drm_panel_mass_convert_part2-v1-0-903b70999ea6@redhat.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Icenowy Zheng , Jagan Teki , Ondrej Jirman , Javier Martinez Canillas , Michael Trimarchi , Michael Walle , Jagan Teki , =?utf-8?q?Guido_G=C3=BCnther?= , Purism Kernel Team , Linus Walleij , Jianhua Lu , Stefan Mavrodiev Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1743607440; l=1385; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=iba0hhsehOqH4Fs29yrW1D1gZNzo6TgJrylYkgV73w0=; b=kIYzJHOq9QAeH1oHJ+EM7ZgfkF92nx6pPlK746fu/eJovqFS/AcPAjGuK/0qdZmwvu5+H0i5D gNoETEmYPHGAdn0RQDYvoz7LAq28g+iDqFRiMU/BgUUwWm/7C8427KV X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move to using the new API devm_drm_panel_alloc() to allocate the panel. Signed-off-by: Anusha Srivatsa --- drivers/gpu/drm/panel/panel-himax-hx8394.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-himax-hx8394.c b/drivers/gpu/drm/panel/panel-himax-hx8394.c index ff994bf0e3cc1af134f40ac3b1712633ae801caf..0e3bf4ba91890e5a859288cb6a9737ed77a343b3 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx8394.c +++ b/drivers/gpu/drm/panel/panel-himax-hx8394.c @@ -611,9 +611,11 @@ static int hx8394_probe(struct mipi_dsi_device *dsi) struct hx8394 *ctx; int ret; - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); - if (!ctx) - return -ENOMEM; + ctx = devm_drm_panel_alloc(dev, struct hx8394, panel, + &hx8394_drm_funcs, + DRM_MODE_CONNECTOR_DSI); + if (IS_ERR(ctx)) + return PTR_ERR(ctx); ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(ctx->reset_gpio)) @@ -645,9 +647,6 @@ static int hx8394_probe(struct mipi_dsi_device *dsi) return dev_err_probe(dev, PTR_ERR(ctx->iovcc), "Failed to request iovcc regulator\n"); - drm_panel_init(&ctx->panel, dev, &hx8394_drm_funcs, - DRM_MODE_CONNECTOR_DSI); - ret = drm_panel_of_backlight(&ctx->panel); if (ret) return ret;