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 7195737F8A8 for ; Fri, 8 May 2026 07:05:16 +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=1778223919; cv=none; b=ARqjAFd6giaMfc7LNymoA0hyNjmAUEIwUhQiqQxhzfiXmYXgEgUHq+IgfIkBt0sZo2x6iGTQS73Xvo0xIVAitpI64fYEHoX3f2hMTblFQ9WNQYyvCTWSxuWrnGL9nJat+qR9whlxgGNew5Lydqk8Nx82MA8wr1xVsz2toVhRheM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778223919; c=relaxed/simple; bh=XvUdWFTzNdyuU5xLadG370AsGNZj7Po+tgb5WdlRF20=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QbOKJXkbTtmT1wdiaULjjpJT2Vc1YArBfs7XFts0iWc7jn2W5TbiHgfDzl7hUyqaSxmT7W37giazcJf8pOg/xk++iXf9mYDn1UVnP4GjP6rDuvkFo1ExKHJ/fPCYkKBpDLKLFlu5nexFWrRMrarwXrzEnioXH3yQQwRe7zfl/mM= 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=ZnSzQnYT; 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="ZnSzQnYT" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778223914; 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=xT5ZKkahajCuu7IltkZe/sz8ns2yzt1V3hkLKL/Sblo=; b=ZnSzQnYTPqVhrF2H1wrW6nzun1rZmkZTFOnuDUKC8yi3r3pRmy5A0BDFOiJcCjrRCiHMhe rpKWPng1+7zVSuSLdgdA/Wb8w9dYkVKmsl9BXfWvd+/8tS0LruNb72/04M5MO1SOVsyeZ1 goETpOEJW1e0M4lW6wSEqUVC4JSfoMU= Received: from mx-prod-mc-08.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-636-jjZ3ZiSxPDWoR8d92DFxtQ-1; Fri, 08 May 2026 03:05:11 -0400 X-MC-Unique: jjZ3ZiSxPDWoR8d92DFxtQ-1 X-Mimecast-MFC-AGG-ID: jjZ3ZiSxPDWoR8d92DFxtQ_1778223909 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8BE7A18002C7; Fri, 8 May 2026 07:05:09 +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 925F7300019F; Fri, 8 May 2026 07:05:06 +0000 (UTC) From: Albert Esteve Date: Fri, 08 May 2026 09:04:45 +0200 Subject: [PATCH v2 05/10] drm/panel/ilitek-ili9806e: 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-5-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=1543; i=aesteve@redhat.com; s=20260303; h=from:subject:message-id; bh=XvUdWFTzNdyuU5xLadG370AsGNZj7Po+tgb5WdlRF20=; b=jB0zqHmUA0TBU9fZ0nf4XhSDti3tC2cVB/PVP3kcTGG/JcnWaAB8rpRgLyucVhtNK+gJsGGQm 2B6N8hM6cOKAnlGC5RDiAt57pAJhWRzgIUU6KF/ZENqG97wtCRW56De 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-ilitek-ili9806e-core.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c index be2cf14401553..53e25d1086db8 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c @@ -78,9 +78,11 @@ int ili9806e_probe(struct device *dev, void *transport, bool set_prepare_prev_first = false; int ret; - ctx = devm_kzalloc(dev, sizeof(struct ili9806e), GFP_KERNEL); - if (!ctx) - return -ENOMEM; + ctx = devm_drm_panel_alloc(dev, __typeof(*ctx), panel, + funcs, connector_type); + + if (IS_ERR(ctx)) + return PTR_ERR(ctx); dev_set_drvdata(dev, ctx); ctx->transport = transport; @@ -103,8 +105,6 @@ int ili9806e_probe(struct device *dev, void *transport, return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), "Failed to get reset-gpios\n"); - drm_panel_init(&ctx->panel, dev, funcs, connector_type); - ret = drm_panel_of_backlight(&ctx->panel); if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); -- 2.53.0