From nobody Fri Dec 19 15:16:32 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 5CEEC218E81 for ; Thu, 27 Mar 2025 14:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743087367; cv=none; b=lPL0XQmm3r8JctHxdugshZsFYtvcIvILALfhSpQ06KM1ERDkjr303dRy04fdKcLgGNo8q4qDjd2Nx+jA07XiHJEAsbtVnzPJ79ZYntT7yt8rGHXzifHQ3eMNBMU95PbGvr6u+ypeTuNT8tQF6qrZMZvUhlgoeJ78nPnYU1W6AnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743087367; c=relaxed/simple; bh=G/LOUd/2xefq/+K9tkawZjMsn5YeytPryd54sCiSKhI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EXf8ZO7bOYUI6TjZDEQZmuudHMqyd8DZTMpDhbylz5bzzd08+LPLTcg5QMQM1oDoDEBDE4T8+or+05EnouxcwvDlV8+bC3GcCJX/q8CnuWgBAAVTUBY4+3Q6SUgZP5fubr7Q8afKsLH5CBmZNJLmw0TG5i3DuYQaqZVS8pgt5m8= 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=JmJh0QTm; arc=none smtp.client-ip=170.10.129.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="JmJh0QTm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743087365; 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=ol/1honC/kq9bsbo+vJ/yLdgWul5QcmvruhVbpK4p80=; b=JmJh0QTmd1tJXd+cXQ2JTxnKGBsDs4cse5u+ajIi4ExJhtXE37NusKs0J3T5Mdbw7NHxCp Pn3J8lFUsaH+n49e2Maxq5gD/XMyUv7tNo5WmGGGO2IQ/FGV4kxekVA9SErRrpijE9QyMa j/vvzj3aPB32sf++8jRbMo8RQZQqqAY= 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-235-EKEiDDACOgemo9ZOIFIKBA-1; Thu, 27 Mar 2025 10:55:58 -0400 X-MC-Unique: EKEiDDACOgemo9ZOIFIKBA-1 X-Mimecast-MFC-AGG-ID: EKEiDDACOgemo9ZOIFIKBA_1743087357 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 D5ABE180025A; Thu, 27 Mar 2025 14:55:56 +0000 (UTC) Received: from asrivats-na.rmtustx.csb (unknown [10.2.16.30]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C3ADC180A803; Thu, 27 Mar 2025 14:55:54 +0000 (UTC) From: Anusha Srivatsa Date: Thu, 27 Mar 2025 10:55:42 -0400 Subject: [PATCH v2 4/4] drm/panel/panel-simple: Use the new 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: quoted-printable Message-Id: <20250327-b4-panel-refcounting-v2-4-b5f5ca551f95@redhat.com> References: <20250327-b4-panel-refcounting-v2-0-b5f5ca551f95@redhat.com> In-Reply-To: <20250327-b4-panel-refcounting-v2-0-b5f5ca551f95@redhat.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Luca Ceresoli , Anusha Srivatsa X-Developer-Signature: v=1; a=ed25519-sha256; t=1743087343; l=1372; i=asrivats@redhat.com; s=20250122; h=from:subject:message-id; bh=G/LOUd/2xefq/+K9tkawZjMsn5YeytPryd54sCiSKhI=; b=INfqMQVpmbSyOot5SD8bv0Vt72aecl6YWRzOF337aaRi/r7Rds33RF0OavdjAOp6dK9hYW3ba rhH6/+FkgsdBL6h4kIN3ztWTaH886/oxxvkvggaF+i23h0GIGqidW5H X-Developer-Key: i=asrivats@redhat.com; a=ed25519; pk=brnIHkBsUZEhyW6Zyn0U92AeIZ1psws/q8VFbIkf1AU= X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Start using the new helper that does the refcounted allocations. v2: check error condition (Luca) Signed-off-by: Anusha Srivatsa Reviewed-by: Luca Ceresoli Reviewed-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-simple.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index 6ba600f97aa4c8daae577823fcf17ef31b0eb46f..df718c4a86cb7dc0cd126e807d3= 3306e5a21d8a0 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -579,9 +579,10 @@ static int panel_simple_probe(struct device *dev, cons= t struct panel_desc *desc) u32 bus_flags; int err; =20 - panel =3D devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL); - if (!panel) - return -ENOMEM; + panel =3D devm_drm_panel_alloc(dev, struct panel_simple, base, + &panel_simple_funcs, desc->connector_type); + if (IS_ERR(panel)) + return PTR_ERR(panel); =20 panel->desc =3D desc; =20 @@ -694,8 +695,6 @@ static int panel_simple_probe(struct device *dev, const= struct panel_desc *desc) pm_runtime_set_autosuspend_delay(dev, 1000); pm_runtime_use_autosuspend(dev); =20 - drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type); - err =3D drm_panel_of_backlight(&panel->base); if (err) { dev_err_probe(dev, err, "Could not find backlight\n"); --=20 2.48.1