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.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 1C7073ECBD0 for ; Thu, 7 May 2026 11:53:43 +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=1778154825; cv=none; b=nLw/sUtW4BgvlPVHkp1DMMdVJizt3iPxBwlhRAa5TI9PNsAQ27Thve/vvnqf9NwW4AN+ASAFknmXddYpTRcSp1Q4zCyrkWMSPzfayxVirLuwXpd/PcDLi+E2OdZTLq22SQG1/jiUkNmEN6LDbjNiCzR+5/uoIPuTRc8h+cAjUoA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778154825; c=relaxed/simple; bh=FpHpJNHkCYgy3y8j0mWQ5oIzER8Ra/+Z02wOwSAM9MI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Qwqx6RAc1/pLqFE/WJwP+5X0hwFpgbGm4yIgrIjKIfaQEzG4aUt8HaqjeTvQvAz8QEDLwLYOB6mtC0zbKqHdQ1QBwb52uBsmrTuxnijr8rXOK9H2o5bKZ+eRt1cJY684O8hqrHlGFwoIuR/cKJcHHlzuulK697PRGbmzrB+qpuw= 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=bYnnh8Ly; 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="bYnnh8Ly" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778154823; 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=IE3BWZyYOdu5leK97onwAvhZpTyClEu6HIwPYoGCizI=; b=bYnnh8LymoBNd5xfrgDjy9wrMfOipQKt5G8y6SqXMnMRUwonlXtGLOcjnP1tJ6uhqXgXpI pItKbKKuVXnq3wHbSzi5LLdKh8BO+1Ks+HBf8+AX09BJs+l+K/cGHZAcZAmAM5gDwCyuzs C7niD1z7BZgmPk/0PPMkvdErTeSncmc= Received: from mx-prod-mc-05.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-589-M_y67Cc-Oz2uFZh3TiP7Pg-1; Thu, 07 May 2026 07:53:40 -0400 X-MC-Unique: M_y67Cc-Oz2uFZh3TiP7Pg-1 X-Mimecast-MFC-AGG-ID: M_y67Cc-Oz2uFZh3TiP7Pg_1778154818 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 46E4D1956088; Thu, 7 May 2026 11:53:38 +0000 (UTC) Received: from [192.168.1.153] (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5DD141953947; Thu, 7 May 2026 11:53:35 +0000 (UTC) From: Albert Esteve Date: Thu, 07 May 2026 13:53:04 +0200 Subject: [PATCH 06/10] drm/panel/tdo-tl070wsh30: 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: <20260507-drm_panel_init_rm-v1-6-51f448c7c291@redhat.com> References: <20260507-drm_panel_init_rm-v1-0-51f448c7c291@redhat.com> In-Reply-To: <20260507-drm_panel_init_rm-v1-0-51f448c7c291@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=1778154793; l=1647; i=aesteve@redhat.com; s=20260303; h=from:subject:message-id; bh=FpHpJNHkCYgy3y8j0mWQ5oIzER8Ra/+Z02wOwSAM9MI=; b=k79Kee0ND/sFz/hICYWHWBkmsQB8rNRNnMCTjw+kOmBpy95zFjCzANyBg4zupJbkloa/fP+Ix U5Mup4kgkZTDOT0e5Mqt4bEy35LrBcsh57SBnPxwuMvQcTQIeDGL0k4 X-Developer-Key: i=aesteve@redhat.com; a=ed25519; pk=YSFz6sOHd2L45+Fr8DIvHTi6lSIjhLZ5T+rkxspJt1s= X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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. Signed-off-by: Albert Esteve --- drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c index 227f97f9b136f..13cfe252a838d 100644 --- a/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c +++ b/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c @@ -162,9 +162,6 @@ static int tdo_tl070wsh30_panel_add(struct tdo_tl070wsh30_panel *tdo_tl070wsh30) return err; } - drm_panel_init(&tdo_tl070wsh30->base, &tdo_tl070wsh30->link->dev, - &tdo_tl070wsh30_panel_funcs, DRM_MODE_CONNECTOR_DSI); - err = drm_panel_of_backlight(&tdo_tl070wsh30->base); if (err) return err; @@ -183,10 +180,13 @@ static int tdo_tl070wsh30_panel_probe(struct mipi_dsi_device *dsi) dsi->format = MIPI_DSI_FMT_RGB888; dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_LPM; - tdo_tl070wsh30 = devm_kzalloc(&dsi->dev, sizeof(*tdo_tl070wsh30), - GFP_KERNEL); - if (!tdo_tl070wsh30) - return -ENOMEM; + tdo_tl070wsh30 = devm_drm_panel_alloc(&dsi->dev, + __typeof(*tdo_tl070wsh30), base, + &tdo_tl070wsh30_panel_funcs, + DRM_MODE_CONNECTOR_DSI); + + if (IS_ERR(tdo_tl070wsh30)) + return PTR_ERR(tdo_tl070wsh30); mipi_dsi_set_drvdata(dsi, tdo_tl070wsh30); tdo_tl070wsh30->link = dsi; -- 2.53.0