From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 A55FB37B400 for ; Fri, 8 May 2026 07:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778223906; cv=none; b=PFuBlAcF2XBGCD/d0b0fWzLE5oMK+i3OGe/COTvfhvdPDB2wAbElDctx09IISN4nL9WHf5mH2Q8tDzo9W4n4H+Qkl7gby0EOMtP/Tcb58N4vNK2bkd4j+lpspBW33hoP+OJ58bSZHV3rBftDRarQ3NsBURjpuOtwzKd93w7VWEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778223906; c=relaxed/simple; bh=J4BYgZvSPEC7KD8UFBDqPUsOJ+VWpE3A9JUo6gEYSUo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dfNU8Fyn439QobVbnEtp5pclhUKvDD+uOFFn62Ms0kOxQUmP2YwkKfXr9n83EfNtQbMnKkaMA3N/qBZoWJHd+RUoNOSFJXXuC8Gp+rfguJmwt78cpIh3blwTPIfguLwJXV9OcsoMHrS12wj3tmb655mQbh0qqRuLK1tvDwGlUCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=FvSGNCjy; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FvSGNCjy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778223902; 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=zEIWSC/LzTP1Y8U/w/oIW/sTeQOqE1yb03dQC3rGJik=; b=FvSGNCjyCDHsFxn9yqeYGiDSiKKSYkGBUChD/ikzNS1EHVyl+NuA3vP+QvJiW49zR0SHmf EETHVvr2SZqkWvVIPsi/45/SDH0RgmOMbzOk6mSD12canOrX7+vge8/BFvI0KEW/C+Dorr BNG9zifnZ/7GUl8tsqMwPYCenwuM8Aw= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-596-eAlVK23ENwq-XxbNR1PBSw-1; Fri, 08 May 2026 03:04:57 -0400 X-MC-Unique: eAlVK23ENwq-XxbNR1PBSw-1 X-Mimecast-MFC-AGG-ID: eAlVK23ENwq-XxbNR1PBSw_1778223896 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CEC9D195605F; Fri, 8 May 2026 07:04:55 +0000 (UTC) Received: from [192.168.1.153] (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 98C243002D2F; Fri, 8 May 2026 07:04:52 +0000 (UTC) From: Albert Esteve Date: Fri, 08 May 2026 09:04:41 +0200 Subject: [PATCH v2 01/10] drm/panel/visionox-g2647fb105: Use refcounted allocation in place of devm_kzalloc() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260508-drm_panel_init_rm-v2-1-0bd4ac429971@redhat.com> References: <20260508-drm_panel_init_rm-v2-0-0bd4ac429971@redhat.com> In-Reply-To: <20260508-drm_panel_init_rm-v2-0-0bd4ac429971@redhat.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Michael Tretter , Michael Walle , Dario Binacchi Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Albert Esteve X-Developer-Signature: v=1; a=ed25519-sha256; t=1778223888; l=1809; i=aesteve@redhat.com; s=20260303; h=from:subject:message-id; bh=J4BYgZvSPEC7KD8UFBDqPUsOJ+VWpE3A9JUo6gEYSUo=; b=OdB8oTTIzPIEDtPlCL7I2gDE7OHi+BTQRhoqnWq7ErdLjWmULyOtjdi/iDRsj8Z4M6wfNwUEH 9XdJZf1rfB0A5+f1UxK3WvAq07jbv8tAwq7JCORW7tbayb6ZoTnZQZ6 X-Developer-Key: i=aesteve@redhat.com; a=ed25519; pk=YSFz6sOHd2L45+Fr8DIvHTi6lSIjhLZ5T+rkxspJt1s= X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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. Also deduplicate the prepare_prev_first assignment that was set both before and after drm_panel_init(). Reviewed-by: Neil Armstrong Reviewed-by: Maxime Ripard Signed-off-by: Albert Esteve --- drivers/gpu/drm/panel/panel-visionox-g2647fb105.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c b/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c index 413849f7b4dec..d5555a1731575 100644 --- a/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c +++ b/drivers/gpu/drm/panel/panel-visionox-g2647fb105.c @@ -207,9 +207,12 @@ static int visionox_g2647fb105_probe(struct mipi_dsi_device *dsi) struct visionox_g2647fb105 *ctx; int ret; - ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); - if (!ctx) - return -ENOMEM; + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel, + &visionox_g2647fb105_panel_funcs, + DRM_MODE_CONNECTOR_DSI); + + if (IS_ERR(ctx)) + return PTR_ERR(ctx); ret = devm_regulator_bulk_get_const(dev, ARRAY_SIZE(visionox_g2647fb105_supplies), @@ -233,10 +236,6 @@ static int visionox_g2647fb105_probe(struct mipi_dsi_device *dsi) ctx->panel.prepare_prev_first = true; - drm_panel_init(&ctx->panel, dev, &visionox_g2647fb105_panel_funcs, - DRM_MODE_CONNECTOR_DSI); - ctx->panel.prepare_prev_first = true; - ctx->panel.backlight = visionox_g2647fb105_create_backlight(dsi); if (IS_ERR(ctx->panel.backlight)) return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), -- 2.53.0