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 01B462F5A29 for ; Fri, 8 May 2026 07:05:06 +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=1778223910; cv=none; b=Z6UMppl8tyt1x9/atClBxUduvkegzg2+OWjKMksHizke81/ZcCM044z/DF6QDhEqisgqZ7Hp7gpguThDzt7XGyoEr9OJQBxQwa7JfO6z+ZRU2NIBQK+33yGKFyqhAtp/1wpYvq7uLiEYabi97XWrskfaKbU6SGGyLzyzwEsef9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778223910; c=relaxed/simple; bh=JUEHCY3nWem2O1Tnc61gI2aykO76LQssUEuDz2yZWsI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FkSKYcbh8+dcPomaVaRrCwlVhOy+cuw4koYC9xzAZJMrae9vZ6G33xBZHDo5liRm+rvrijrPMoDuxxb1colbrXVGg6qG0oVcp/XMjWa7XOo6nCXMAU5ffN848D7H+606xFxb4FUm6cQYnQxhKBBXadXGLRBYFgyfl1YUaTSCUjQ= 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=Chna1UKl; 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="Chna1UKl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778223904; 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=q/eStwIMpD08Sr4D7cAHGOU+XdQrOvVtuLJ5JFB1WqE=; b=Chna1UKlKU2jy/o6z48eFLRonJOSsAig0x/beqDRbVCC7ddCVJRf0GMtQZOnUus/FssjxH 1cSAZhzZHtRnWK9Fc2o9+0m3d+bPhV+CM3WhqlYZuMhzuk4YE3/fFyP9ZX5LHjAqY4Okya y8XwFLZPh4s6mf6OrwnlbByG9uhW5vw= 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-218-k2z99pc4OX2TkdVMySYzVQ-1; Fri, 08 May 2026 03:05:01 -0400 X-MC-Unique: k2z99pc4OX2TkdVMySYzVQ-1 X-Mimecast-MFC-AGG-ID: k2z99pc4OX2TkdVMySYzVQ_1778223899 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0E58418005B5; Fri, 8 May 2026 07:04:59 +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 3D655300019F; Fri, 8 May 2026 07:04:56 +0000 (UTC) From: Albert Esteve Date: Fri, 08 May 2026 09:04:42 +0200 Subject: [PATCH v2 02/10] drm/panel/samsung-s6e63m0: 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-2-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=1556; i=aesteve@redhat.com; s=20260303; h=from:subject:message-id; bh=JUEHCY3nWem2O1Tnc61gI2aykO76LQssUEuDz2yZWsI=; b=naTwUv6X5YF7pv7e68QjrGn4pu+55fhXf7r5Axvv0895cLLnBW0DNaVGVRqTtm/kQzbcwJm/a g90AjcfZ1IgAshdpBYJtOZMhIW+eV2JEH++A5SLwcNrkYWxxr+gabiW 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. Reviewed-by: Neil Armstrong Reviewed-by: Maxime Ripard Signed-off-by: Albert Esteve --- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c index ea241c89593b6..997115b1e541d 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -677,9 +677,13 @@ int s6e63m0_probe(struct device *dev, void *trsp, u32 max_brightness; int ret; - ctx = devm_kzalloc(dev, sizeof(struct s6e63m0), GFP_KERNEL); - if (!ctx) - return -ENOMEM; + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel, + &s6e63m0_drm_funcs, + dsi_mode ? DRM_MODE_CONNECTOR_DSI : + DRM_MODE_CONNECTOR_DPI); + + if (IS_ERR(ctx)) + return PTR_ERR(ctx); ctx->transport_data = trsp; ctx->dsi_mode = dsi_mode; @@ -712,10 +716,6 @@ int s6e63m0_probe(struct device *dev, void *trsp, return PTR_ERR(ctx->reset_gpio); } - drm_panel_init(&ctx->panel, dev, &s6e63m0_drm_funcs, - dsi_mode ? DRM_MODE_CONNECTOR_DSI : - DRM_MODE_CONNECTOR_DPI); - ret = s6e63m0_backlight_register(ctx, max_brightness); if (ret < 0) return ret; -- 2.53.0