From nobody Wed Oct 8 19:05:21 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 837DC1F4CBE for ; Wed, 25 Jun 2025 06:48:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834130; cv=none; b=SyYyeuXBVuZfSUMX2UsAqrNUnkiQGRxtPyi99f7rhWSznMjlV/qm3f6MebVanVN/9PMC3T+M7S35Vx5UWxnJFg1mA6haGve6ejwfRm3iF1Ve4SWyI6oSW3qxcO4bQNjluePxDJ4lq4/g4CF/WLQwxg8m09Kl93c3qWWfeCH/vtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834130; c=relaxed/simple; bh=3k4h3hHEk7NoxoOrxbmYWfStsX8RNDzQCxVAQ8vhmp4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y+D/li21Ip4Kf4eI/ahRi+Y1CsQ6AE4gSqJznRnflqVZOrMvhVfc/ys08lSEDKS3wc4oAx9+MEWOQn5G71YHIFkhBSE2rOO3+zj1URJDBapukvXhH4X8IeJ3b/Hg4Ku4iJwlyZjQFZ59RdtDE6LPVnJBQ/esEP64qTrR6BfK4kw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WV3jVN+e; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WV3jVN+e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4063C4CEF1; Wed, 25 Jun 2025 06:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750834130; bh=3k4h3hHEk7NoxoOrxbmYWfStsX8RNDzQCxVAQ8vhmp4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WV3jVN+efUjJ+84d4CMKIfuYU8B7WrweRTX286U1nlajQK/tBOCBzAS2eta3heGBw NeOCs+ynbc/JlSvMFWp+Q4RdfWF2cRDR1KGp67pGTF5AesdgYRQMdH3bE8jZy5RyTH m3N/RJI1y9EN1jVRBjkVXeQd0Qk2PoxplxIC4+GaLSUlg2qRP2JFCimmZ585AcB9LR wIDKKNWyfjMwm57dui3Ub1U0fxWyiHtbIlBNyb/pWkCzud/EDrpVir+6FGUuophyFx oAjFb3F1lSJdeVsCJjZ9uUqAdqJKW8nfbmCOd4nYQRY0oyAymI6rSp28AdHjysDtQw t/+0aoE///kVw== From: Maxime Ripard Date: Wed, 25 Jun 2025 08:48:38 +0200 Subject: [PATCH 1/5] drm/mipi-dsi: Add dev_is_mipi_dsi function 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: <20250625-drm-panel-simple-fixes-v1-1-c428494a86b8@kernel.org> References: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> In-Reply-To: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Luca Ceresoli , Anusha Srivatsa , Francesco Dolcini Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2020; i=mripard@kernel.org; h=from:subject:message-id; bh=3k4h3hHEk7NoxoOrxbmYWfStsX8RNDzQCxVAQ8vhmp4=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDBnRs08VH/m8aL61wUQO34Z1E1fX+Eg6r+/aeT52wf0jK 04Eh3OVdUxlYRDmZJAVU2R5IhN2enn74ioH+5U/YOawMoEMYeDiFICJ/PjFWO+9MkX9ut4X5b0R Rc27DsiWK8h/aZtx+6n03C3n177fZySy4U3pGZeGoOoZi87b3p+Z58tYn28+R1iaU6i+I944+/T aVhXfva9M2e5+E9u8bzHLhb3BR9jExKxVbzfOtjoxQeb/dp9MAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D This will be especially useful for generic panels (like panel-simple) which can take different code path depending on if they are MIPI-DSI devices or platform devices. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_mipi_dsi.c | 3 ++- include/drm/drm_mipi_dsi.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index e5184a0c24651756ee0b1eb27d94083d63eb35a7..21fd647f8ce1a6a862e2f8fb532= 0e701f26f614f 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -89,16 +89,17 @@ static const struct dev_pm_ops mipi_dsi_device_pm_ops = =3D { .thaw =3D pm_generic_thaw, .poweroff =3D pm_generic_poweroff, .restore =3D pm_generic_restore, }; =20 -static const struct bus_type mipi_dsi_bus_type =3D { +const struct bus_type mipi_dsi_bus_type =3D { .name =3D "mipi-dsi", .match =3D mipi_dsi_device_match, .uevent =3D mipi_dsi_uevent, .pm =3D &mipi_dsi_device_pm_ops, }; +EXPORT_SYMBOL_GPL(mipi_dsi_bus_type); =20 /** * of_find_mipi_dsi_device_by_node() - find the MIPI DSI device matching a * device tree node * @np: device tree node diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index b37860f4a895c25ef8ba1c5b3f44827ef53aa100..6d2c08e8110151a97620389197f= 1ef79c058329d 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -221,10 +221,13 @@ struct mipi_dsi_multi_context { =20 #define MIPI_DSI_MODULE_PREFIX "mipi-dsi:" =20 #define to_mipi_dsi_device(__dev) container_of_const(__dev, struct mipi_ds= i_device, dev) =20 +extern const struct bus_type mipi_dsi_bus_type; +#define dev_is_mipi_dsi(dev) ((dev)->bus =3D=3D &mipi_dsi_bus_type) + /** * mipi_dsi_pixel_format_to_bpp - obtain the number of bits per pixel for = any * given pixel format defined by the MIPI D= SI * specification * @fmt: MIPI DSI pixel format --=20 2.49.0 From nobody Wed Oct 8 19:05:21 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5FD221FAC4D for ; Wed, 25 Jun 2025 06:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834133; cv=none; b=Mf8MZZN9Jf1nasmvVLBElXYNBSDnLpF3aGIyug19k+9T47/babCces2ChzQvYAW0xXmfxOK68KK2mOkDKRK6YLG3vYtKJTtEryGCP1yesuve1R9CawHJdUuLQ5NHkt4aKW7dssGytmqMg5Q0B3eklQa1ozpwLVLGBIEooJdDPY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834133; c=relaxed/simple; bh=I0Wn0v0oJ34lZSaquWxq7quZ9zp2CkhUtsLyYrYJvuQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k1rPIQ4s1Z/9FGhNg21jAuVD6ZnO5hqgMC3r5LL1tKxXdB4Gt946GpT484ESgk8a98MTlGyifrwoLBltUgLO/I/6O/7m5hUBSdQJPGkAlZD+igm49E1kl2Dr1I0iFenh1BzLQ6IxDSgJfeITdouwlPwF6P11Idzv2gjOXHunbcM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=h305p51M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="h305p51M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98594C4CEEA; Wed, 25 Jun 2025 06:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750834132; bh=I0Wn0v0oJ34lZSaquWxq7quZ9zp2CkhUtsLyYrYJvuQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=h305p51MiLuNs2IfqA1Wlo0IuGHQ+kyUxTTfNmtw3aYyNpPDcrEbrOWLV2gI4OBjX 4dPSm46INqjVIBoFNPoNlk0EGG/izp7yCxUouhldSPy+QNr+XlW8IWLBotTVcEMp57 slimMjsfumVtoULzkMm1xDtlWYKWTnn9GwgkXLTj3q42ScEcUw08HTGj2FNIbqGqni dH8hbufHHOXT7y4301KzGxi5/ZYjL5jIHszyvmOMfK+LTJ6md8yagZOjmdfweeGTod qs3ybZsWB7RdkSKdUbGhLgBi/0U/dPPV1zKt+Ty0UcEeGuTLWSZZLwUKYhxvnxNQK1 vHVVTvihN6m/g== From: Maxime Ripard Date: Wed, 25 Jun 2025 08:48:39 +0200 Subject: [PATCH 2/5] drm/panel: panel-simple: make panel_dpi_probe return a panel_desc 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: <20250625-drm-panel-simple-fixes-v1-2-c428494a86b8@kernel.org> References: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> In-Reply-To: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Luca Ceresoli , Anusha Srivatsa , Francesco Dolcini Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3848; i=mripard@kernel.org; h=from:subject:message-id; bh=I0Wn0v0oJ34lZSaquWxq7quZ9zp2CkhUtsLyYrYJvuQ=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDBnRs0+FXf9x1E+qg9mV9U1O2VzGYzfz5bokLfk1TWcv+ apqdEykYyoLgzAng6yYIssTmbDTy9sXVznYr/wBM4eVCWQIAxenAEzkZyZjw0qhxztfm0/Xkfr/ VcdBKk/uzqYpd0oYN91zfRQVGxy0laPtlVB3ys2pr3OvLL88c+4EL8aGl/pluf2H7iqfNfeoutD eo2g1fduNRe63HA5vqp/Rsnii8tqAJZXuJ/SWfPDR0OhYZ94GAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D If the panel-simple driver is probed from a panel-dpi compatible, the driver will use an empty panel_desc structure as a descriminant. It will then allocate and fill another panel_desc as part of its probe. However, that allocation needs to happen after the panel_simple structure has been allocated, since panel_dpi_probe(), the function doing the panel_desc allocation and initialization, takes a panel_simple pointer as an argument. This pointer is used to fill the panel_simple->desc pointer that is still initialized with the empty panel_desc when panel_dpi_probe() is called. Since commit de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in place of devm_kzalloc()"), we will need the panel connector type found in panel_desc to allocate panel_simple. This creates a circular dependency where we need panel_desc to create panel_simple, and need panel_simple to create panel_desc. Let's break that dependency by making panel_dpi_probe simply return the panel_desc it initialized and move the panel_simple->desc assignment to the caller. This will not fix the breaking commit entirely, but will move us towards the right direction. Fixes: de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in pla= ce of devm_kzalloc()") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-simple.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index 0a3b26bb4d731c54614e24e38018c308acd5367a..89188e683822f9202ec580c9a29= 4e42083b9704a 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -430,12 +430,11 @@ static const struct drm_panel_funcs panel_simple_func= s =3D { .get_timings =3D panel_simple_get_timings, }; =20 static struct panel_desc panel_dpi; =20 -static int panel_dpi_probe(struct device *dev, - struct panel_simple *panel) +static struct panel_desc *panel_dpi_probe(struct device *dev) { struct display_timing *timing; const struct device_node *np; struct panel_desc *desc; unsigned int bus_flags; @@ -443,21 +442,21 @@ static int panel_dpi_probe(struct device *dev, int ret; =20 np =3D dev->of_node; desc =3D devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL); if (!desc) - return -ENOMEM; + return ERR_PTR(-ENOMEM); =20 timing =3D devm_kzalloc(dev, sizeof(*timing), GFP_KERNEL); if (!timing) - return -ENOMEM; + return ERR_PTR(-ENOMEM); =20 ret =3D of_get_display_timing(np, "panel-timing", timing); if (ret < 0) { dev_err(dev, "%pOF: no panel-timing node found for \"panel-dpi\" binding= \n", np); - return ret; + return ERR_PTR(ret); } =20 desc->timings =3D timing; desc->num_timings =3D 1; =20 @@ -471,13 +470,11 @@ static int panel_dpi_probe(struct device *dev, desc->bus_flags =3D bus_flags; =20 /* We do not know the connector for the DT node, so guess it */ desc->connector_type =3D DRM_MODE_CONNECTOR_DPI; =20 - panel->desc =3D desc; - - return 0; + return desc; } =20 #define PANEL_SIMPLE_BOUNDS_CHECK(to_check, bounds, field) \ (to_check->field.typ >=3D bounds->field.min && \ to_check->field.typ <=3D bounds->field.max) @@ -611,14 +608,17 @@ static int panel_simple_probe(struct device *dev, con= st struct panel_desc *desc) return -EPROBE_DEFER; } =20 if (desc =3D=3D &panel_dpi) { /* Handle the generic panel-dpi binding */ - err =3D panel_dpi_probe(dev, panel); - if (err) + desc =3D panel_dpi_probe(dev); + if (IS_ERR(desc)) { + err =3D PTR_ERR(desc); goto free_ddc; - desc =3D panel->desc; + } + + panel->desc =3D desc; } else { if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) panel_simple_parse_panel_timing_node(dev, panel, &dt); } =20 --=20 2.49.0 From nobody Wed Oct 8 19:05:21 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 49E0B1FCFEE for ; Wed, 25 Jun 2025 06:48:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834136; cv=none; b=O9rjwHpcQhMNvteL/vOp9xgK2ZMKSoA9vkdCexHXDbnGWkIgfLPBoZFy+WKr9opxiI/s/A3UYPGx76Q5qAcmWOuKq1+sX0gLK+MJqtOarsbGaRuBXoOu182F+ltOmIqpWyNlYsUNGk31f0U5dx8rcZq4Yla/vaJKuwPH/wpxFDU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834136; c=relaxed/simple; bh=D9tNmt4CZw29EZUUZcqPTZ6E8NGJet4lpsy9/3O0OYE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ErDq8W8SHClYMyuRMnfPIcb5u0xn3Klg9FnTI2Ed59OyjZOz9hfutTsAMYLP2lGOVjuBwfIlj8M4SquTkhDY4NW+lDGwdznubp4BbxKDaj511AFT5opt7xJu6jrt4D5ycAGabX/Vh7BErp+A+R46iK9/CiIsBo1bWdYIUnQF1Ws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y9mGVbKO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y9mGVbKO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83345C4CEEE; Wed, 25 Jun 2025 06:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750834135; bh=D9tNmt4CZw29EZUUZcqPTZ6E8NGJet4lpsy9/3O0OYE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Y9mGVbKOBF5ejTzcxmGdL/jIBhWDaddNgLrrxBdcYAj+kbrXMsikeXheJEsBsFkh3 7mCkhgIJLoRC/4NKL+3kA6VgpogQoJsFjdf3nABZNYkNDfHseWCCyZX5UmUXN5+86u PPODUqmugza2SQEyBMxiVDcP0Kq1P0uJip7ku0d+cZX3SdlcUBFtq97oTQS/+W2ZSf YsCD0Hyv/oAxvx2peAu/9WXSYDqdf83JUVvVcMlSxJknU9BxAZu5Po8KNvWdxwTfJK leonlHaa9GDLpJjW8oY0CGQOc5byJlqfxOiIVdhWggdD6K7XhwMrJ50WRnmDEgaDLE cKPhDwlpJejpw== From: Maxime Ripard Date: Wed, 25 Jun 2025 08:48:40 +0200 Subject: [PATCH 3/5] drm/panel: panel-simple: Make panel_simple_probe return its panel 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: <20250625-drm-panel-simple-fixes-v1-3-c428494a86b8@kernel.org> References: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> In-Reply-To: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Luca Ceresoli , Anusha Srivatsa , Francesco Dolcini Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5194; i=mripard@kernel.org; h=from:subject:message-id; bh=D9tNmt4CZw29EZUUZcqPTZ6E8NGJet4lpsy9/3O0OYE=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDBnRs08fn73jhuKUKVfN1JSZ8nW1v1qJBZg+ZVxx1PvPn e2GvzMtOqayMAhzMsiKKbI8kQk7vbx9cZWD/cofMHNYmUCGMHBxCsBEOhYz1spcYitfa85zLeC3 oM9ixS3qkdOtUxqsCi80vtyrm+rzvkjknPLD35991ERnMmrduh/yi7HhLL/UBXHuXS6ZmVNq19h N23GZ/zLT6yOPVP5Mmnfj5eQPLg+PSoe37l506re06NXpQvI/AQ== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D In order to fix the regession introduced by commit de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in place of devm_kzalloc()"), we need to move the panel_desc lookup into the common panel_simple_probe() function. There's two callers for that function, the probe implementations of the platform and MIPI-DSI drivers panel-simple implements. The MIPI-DSI driver's probe will need to access the current panel_desc to initialize properly, which won't be possible anymore if we make that lookup in panel_simple_probe(). However, we can make panel_simple_probe() return the initialized panel_simple structure it allocated, which will contain a pointer to the associated panel_desc in its desc field. This doesn't fix de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in place of devm_kzalloc()") still, but makes progress towards that goal. Fixes: de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in pla= ce of devm_kzalloc()") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-simple.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index 89188e683822f9202ec580c9a294e42083b9704a..e70ee2d4a538caaae673507b93e= 02b444a2e1640 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -565,11 +565,11 @@ static int panel_simple_override_nondefault_lvds_data= mapping(struct device *dev, } =20 return 0; } =20 -static int panel_simple_probe(struct device *dev, const struct panel_desc = *desc) +static struct panel_simple *panel_simple_probe(struct device *dev, const s= truct panel_desc *desc) { struct panel_simple *panel; struct display_timing dt; struct device_node *ddc; int connector_type; @@ -577,37 +577,37 @@ static int panel_simple_probe(struct device *dev, con= st struct panel_desc *desc) int err; =20 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); + return ERR_CAST(panel); =20 panel->desc =3D desc; =20 panel->supply =3D devm_regulator_get(dev, "power"); if (IS_ERR(panel->supply)) - return PTR_ERR(panel->supply); + return ERR_CAST(panel->supply); =20 panel->enable_gpio =3D devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW); if (IS_ERR(panel->enable_gpio)) - return dev_err_probe(dev, PTR_ERR(panel->enable_gpio), - "failed to request GPIO\n"); + return dev_err_cast_probe(dev, panel->enable_gpio, + "failed to request GPIO\n"); =20 err =3D of_drm_get_panel_orientation(dev->of_node, &panel->orientation); if (err) { dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, err); - return err; + return ERR_PTR(err); } =20 ddc =3D of_parse_phandle(dev->of_node, "ddc-i2c-bus", 0); if (ddc) { panel->ddc =3D of_find_i2c_adapter_by_node(ddc); of_node_put(ddc); =20 if (!panel->ddc) - return -EPROBE_DEFER; + return ERR_PTR(-EPROBE_DEFER); } =20 if (desc =3D=3D &panel_dpi) { /* Handle the generic panel-dpi binding */ desc =3D panel_dpi_probe(dev); @@ -701,20 +701,20 @@ static int panel_simple_probe(struct device *dev, con= st struct panel_desc *desc) goto disable_pm_runtime; } =20 drm_panel_add(&panel->base); =20 - return 0; + return panel; =20 disable_pm_runtime: pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); free_ddc: if (panel->ddc) put_device(&panel->ddc->dev); =20 - return err; + return ERR_PTR(err); } =20 static void panel_simple_shutdown(struct device *dev) { struct panel_simple *panel =3D dev_get_drvdata(dev); @@ -5375,16 +5375,21 @@ static const struct of_device_id platform_of_match[= ] =3D { MODULE_DEVICE_TABLE(of, platform_of_match); =20 static int panel_simple_platform_probe(struct platform_device *pdev) { const struct panel_desc *desc; + struct panel_simple *panel; =20 desc =3D of_device_get_match_data(&pdev->dev); if (!desc) return -ENODEV; =20 - return panel_simple_probe(&pdev->dev, desc); + panel =3D panel_simple_probe(&pdev->dev, desc); + if (IS_ERR(panel)) + return PTR_ERR(panel); + + return 0; } =20 static void panel_simple_platform_remove(struct platform_device *pdev) { panel_simple_remove(&pdev->dev); @@ -5651,20 +5656,22 @@ static const struct of_device_id dsi_of_match[] =3D= { MODULE_DEVICE_TABLE(of, dsi_of_match); =20 static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) { const struct panel_desc_dsi *desc; + struct panel_simple *panel; int err; =20 desc =3D of_device_get_match_data(&dsi->dev); if (!desc) return -ENODEV; =20 - err =3D panel_simple_probe(&dsi->dev, &desc->desc); - if (err < 0) - return err; + panel =3D panel_simple_probe(&dsi->dev, &desc->desc); + if (IS_ERR(panel)) + return PTR_ERR(panel); =20 + desc =3D container_of(panel->desc, struct panel_desc_dsi, desc); dsi->mode_flags =3D desc->flags; dsi->format =3D desc->format; dsi->lanes =3D desc->lanes; =20 err =3D mipi_dsi_attach(dsi); --=20 2.49.0 From nobody Wed Oct 8 19:05:21 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DFE121FF1A1 for ; Wed, 25 Jun 2025 06:48:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834139; cv=none; b=GiaZNWklr/IZBOlTEao6DiP2GvBONIVsbK5zW0riIkqF/39d2/ey+B32K6BAbaMct2u0oD0O8zYVMnbsyxXvyttba/dsnPwfAFabioGC8/vMAm+IFn2mxSyxrivqGeS0RSh2q8/1/+ESkTYQlsMksEjLGBZF/uH03Gz3UOu//Dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834139; c=relaxed/simple; bh=f+KfQM4TtP/sqrm1b9UkeC8/43JwSB+sdZZLVFY5aKE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mjo9hYqLZXKCgWXevj3LUl0aSPksBaocnqIVAr/YEu6O7IsmVvWUbSK2uVR3SAaVP7YtCh6oJutyOgksPGWnxmbegN9VCTJCUXs03qLE6rGzmDvrvHKY+00Lw2LQdcnBBCPL5VGs2g5bLYA7T3RSkQpP2Y4DSZDzUESlntW947E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IlPQzXsK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IlPQzXsK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EECDC4CEF3; Wed, 25 Jun 2025 06:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750834138; bh=f+KfQM4TtP/sqrm1b9UkeC8/43JwSB+sdZZLVFY5aKE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IlPQzXsKKBLvTJtxFQ7wxexXmJBQLSNCEEc7BYZfEdksfovbUBE/Kb7HyIYdD7f8O CypRoFBtTDwIYzDfUkfgaeZnGhvHrhTkMmwvt8+GG48psVomlXpD2/X/Fq+Bx5y0pI LvoJF4bTwjUHEVA91eeZOQB68FCN7vE8Eephb/4h0/VNCpVONaKYg2SPAlq+6gZGM6 2kgT7j1qmBpVMqjBFSQpUYULaXB0OocRN/SJtPiPvGVNTPHbrYPKmfupAnRwX975+Z igY2UPja+z3WZu89mVbFzmPdqgN8qWbcdew5i0Y/YtdeSvQLybhwz4uyui/MQr+ZUF 1EHRmnrL0rRgA== From: Maxime Ripard Date: Wed, 25 Jun 2025 08:48:41 +0200 Subject: [PATCH 4/5] drm/panel: panel-simple: Add function to look panel data up 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: <20250625-drm-panel-simple-fixes-v1-4-c428494a86b8@kernel.org> References: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> In-Reply-To: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Luca Ceresoli , Anusha Srivatsa , Francesco Dolcini Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6286; i=mripard@kernel.org; h=from:subject:message-id; bh=f+KfQM4TtP/sqrm1b9UkeC8/43JwSB+sdZZLVFY5aKE=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDBnRs0+7nTcvaTp7rtD6s3tjzVMLm4N9XFMWPUxlqG77G xKx9E9nx1QWBmFOBlkxRZYnMmGnl7cvrnKwX/kDZg4rE8gQBi5OAZhI1m7GGs6IMxy64UmR73wa ZZcLr93vfOW9fuDl3RLq8gseJt95f0z12MxuvsvaH0KUUw5tP6VVxFifF5hxh8+Hw3K/j0ddpcT h3QqMk45s0Dx3+Wv0/J+LRQrUDCYxyM3d6G4Wv8BkHrPViccA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D Commit de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in place of devm_kzalloc()") moved the call to drm_panel_init into the devm_drm_panel_alloc(), which needs a connector type to initialize properly. In the panel-dpi compatible case, the passed panel_desc structure is an empty one used as a discriminant, and the connector type it contains isn't actually initialized. It is initialized through a call to panel_dpi_probe() later in the function, which used to be before the call to drm_panel_init() that got merged into devm_drm_panel_alloc(). So, we do need a proper panel_desc pointer before the call to devm_drm_panel_alloc() now. All cases associate their panel_desc with the panel compatible and use of_device_get_match_data, except for the panel-dpi compatible. In that case, we're expected to call panel_dpi_probe, which will allocate and initialize the panel_desc for us. Let's create such a helper function that would be called first in the driver and will lookup the desc by compatible, or allocate one if relevant. Reported-by: Francesco Dolcini Closes: https://lore.kernel.org/all/20250612081834.GA248237@francesco-nb/ Fixes: de04bb0089a9 ("drm/panel/panel-simple: Use the new allocation in pla= ce of devm_kzalloc()") Signed-off-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-simple.c | 81 +++++++++++++++++++++-----------= ---- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index e70ee2d4a538caaae673507b93e02b444a2e1640..d3390ba4ecec5a5aa531c12f51e= ebdf1ed9d5545 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -24,10 +24,11 @@ #include #include #include #include #include +#include #include #include #include #include =20 @@ -134,10 +135,18 @@ struct panel_desc { =20 /** @connector_type: LVDS, eDP, DSI, DPI, etc. */ int connector_type; }; =20 +struct panel_desc_dsi { + struct panel_desc desc; + + unsigned long flags; + enum mipi_dsi_pixel_format format; + unsigned int lanes; +}; + struct panel_simple { struct drm_panel base; =20 ktime_t unprepared_time; =20 @@ -565,19 +574,52 @@ static int panel_simple_override_nondefault_lvds_data= mapping(struct device *dev, } =20 return 0; } =20 -static struct panel_simple *panel_simple_probe(struct device *dev, const s= truct panel_desc *desc) +static const struct panel_desc *panel_simple_get_desc(struct device *dev) { + if (dev_is_mipi_dsi(dev)) { + const struct panel_desc_dsi *dsi_desc; + + dsi_desc =3D of_device_get_match_data(dev); + if (!dsi_desc) + return ERR_PTR(-ENODEV); + + return &dsi_desc->desc; + } + + if (dev_is_platform(dev)) { + const struct panel_desc *desc; + + desc =3D of_device_get_match_data(dev); + if (!desc) + return ERR_PTR(-ENODEV); + + if (desc =3D=3D &panel_dpi) + return panel_dpi_probe(dev); + + return desc; + } + + return ERR_PTR(-ENODEV); +} + +static struct panel_simple *panel_simple_probe(struct device *dev) +{ + const struct panel_desc *desc; struct panel_simple *panel; struct display_timing dt; struct device_node *ddc; int connector_type; u32 bus_flags; int err; =20 + desc =3D panel_simple_get_desc(dev); + if (IS_ERR(desc)) + return ERR_CAST(desc); + panel =3D devm_drm_panel_alloc(dev, struct panel_simple, base, &panel_simple_funcs, desc->connector_type); if (IS_ERR(panel)) return ERR_CAST(panel); =20 @@ -606,23 +648,13 @@ static struct panel_simple *panel_simple_probe(struct= device *dev, const struct =20 if (!panel->ddc) return ERR_PTR(-EPROBE_DEFER); } =20 - if (desc =3D=3D &panel_dpi) { - /* Handle the generic panel-dpi binding */ - desc =3D panel_dpi_probe(dev); - if (IS_ERR(desc)) { - err =3D PTR_ERR(desc); - goto free_ddc; - } - - panel->desc =3D desc; - } else { - if (!of_get_display_timing(dev->of_node, "panel-timing", &dt)) - panel_simple_parse_panel_timing_node(dev, panel, &dt); - } + if ((desc !=3D &panel_dpi) && + !of_get_display_timing(dev->of_node, "panel-timing", &dt)) + panel_simple_parse_panel_timing_node(dev, panel, &dt); =20 if (desc->connector_type =3D=3D DRM_MODE_CONNECTOR_LVDS) { /* Optional data-mapping property for overriding bus format */ err =3D panel_simple_override_nondefault_lvds_datamapping(dev, panel); if (err) @@ -5374,18 +5406,13 @@ static const struct of_device_id platform_of_match[= ] =3D { }; MODULE_DEVICE_TABLE(of, platform_of_match); =20 static int panel_simple_platform_probe(struct platform_device *pdev) { - const struct panel_desc *desc; struct panel_simple *panel; =20 - desc =3D of_device_get_match_data(&pdev->dev); - if (!desc) - return -ENODEV; - - panel =3D panel_simple_probe(&pdev->dev, desc); + panel =3D panel_simple_probe(&pdev->dev); if (IS_ERR(panel)) return PTR_ERR(panel); =20 return 0; } @@ -5415,18 +5442,10 @@ static struct platform_driver panel_simple_platform= _driver =3D { .probe =3D panel_simple_platform_probe, .remove =3D panel_simple_platform_remove, .shutdown =3D panel_simple_platform_shutdown, }; =20 -struct panel_desc_dsi { - struct panel_desc desc; - - unsigned long flags; - enum mipi_dsi_pixel_format format; - unsigned int lanes; -}; - static const struct drm_display_mode auo_b080uan01_mode =3D { .clock =3D 154500, .hdisplay =3D 1200, .hsync_start =3D 1200 + 62, .hsync_end =3D 1200 + 62 + 4, @@ -5659,15 +5678,11 @@ static int panel_simple_dsi_probe(struct mipi_dsi_d= evice *dsi) { const struct panel_desc_dsi *desc; struct panel_simple *panel; int err; =20 - desc =3D of_device_get_match_data(&dsi->dev); - if (!desc) - return -ENODEV; - - panel =3D panel_simple_probe(&dsi->dev, &desc->desc); + panel =3D panel_simple_probe(&dsi->dev); if (IS_ERR(panel)) return PTR_ERR(panel); =20 desc =3D container_of(panel->desc, struct panel_desc_dsi, desc); dsi->mode_flags =3D desc->flags; --=20 2.49.0 From nobody Wed Oct 8 19:05:21 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DEAB5202987 for ; Wed, 25 Jun 2025 06:49:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834142; cv=none; b=HWQ053ZAkTjVzHrt3BwFwJN0mS7r4EIEm5yimHPz8cSpMzWbnhUQfmPKf3vbDGaU/i9zo0lbs123NLgvlg+mNcMj00WRsr3XUI8Rugw4wFS7Ej5IgOy4TN2p3GqERCng7v6vV2Pq8FkoEzfjCpXfNyYbwPILrf7I1EhuMs4z+EM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750834142; c=relaxed/simple; bh=996mJ21JrIRt/8zZvRVt3DWeLhU4aeBd9zfaG+L5ogU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oW8hWMTHRrgWvcfxredk+qaY56p3N9i4tHUDZ6+wypL+J94EU81S+Nn8dmi2+j+FOAB+/sTUCoM4C3pPhKnEH5dYsAOP9AftAHmOntq4Xjt7dbSFrEdRRvH+vNdzpdKPOZsZEo+d+5phQ6TR1GrfRausg344IxW7lfXzSLqDp0M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YWsw54oO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YWsw54oO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15927C4CEF1; Wed, 25 Jun 2025 06:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1750834141; bh=996mJ21JrIRt/8zZvRVt3DWeLhU4aeBd9zfaG+L5ogU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YWsw54oOtBeVkNGC96P9c4nS6RnKErmEtzoBb4O+5jMAeWJjcq28NP3LyWrcy/FuD Z1/tUFqXYkF/6+QEGV0IdAJwuhdAb+FsZ3ypX9jYSkikVtvgq1OriSlpkC18VTGcai e2cdflc5YM1Vde2kPtb7lPKJCD6mnuEWK6ggg4I2LccOjoO4UvsrTy55dpVdOLCx32 Ic4NEAL8uWjDImhcooBKUQ62xpbQhCC8pvtMCWE5/rvpXVnmSca+hAvuXuI9eqq+at si0lkIor5Hd7bVjsX/lroM/nknebINJD1VGvsNBqxxiQ95MITpFG05hhFArgqP60gf hn7n92faWSHKw== From: Maxime Ripard Date: Wed, 25 Jun 2025 08:48:42 +0200 Subject: [PATCH 5/5] drm/panel: panel-simple: get rid of panel_dpi hack 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: <20250625-drm-panel-simple-fixes-v1-5-c428494a86b8@kernel.org> References: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> In-Reply-To: <20250625-drm-panel-simple-fixes-v1-0-c428494a86b8@kernel.org> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Luca Ceresoli , Anusha Srivatsa , Francesco Dolcini Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2757; i=mripard@kernel.org; h=from:subject:message-id; bh=996mJ21JrIRt/8zZvRVt3DWeLhU4aeBd9zfaG+L5ogU=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDBnRs898i9Ng5XNwP/azqFpxy+/4A1VR6SKbBarCJx/JX MPt/mB6x1QWBmFOBlkxRZYnMmGnl7cvrnKwX/kDZg4rE8gQBi5OAZhIxDbGhm+Ldl65t+Z4xtud dbsW7rxSWsIssvfA7+9ezkeeMrerW0dzt9jJtF/d+07sSM32PwnFLxgbDsdvtjk2O6HnFrdLNH/ Rs2hBT3n1fut/P6b+m6B4PK1wRaroqrVLQq0i06QLtjmt5XwNAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D The empty panel_dpi struct was only ever used as a discriminant, but it's kind of a hack, and with the reworks done in the previous patches, we shouldn't need it anymore. Let's get rid of it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/panel/panel-simple.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/p= anel-simple.c index d3390ba4ecec5a5aa531c12f51eebdf1ed9d5545..d19170a4531dff7b6e522b6d58e= 72d0dadc70680 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -437,12 +437,10 @@ static const struct drm_panel_funcs panel_simple_func= s =3D { .get_modes =3D panel_simple_get_modes, .get_orientation =3D panel_simple_get_orientation, .get_timings =3D panel_simple_get_timings, }; =20 -static struct panel_desc panel_dpi; - static struct panel_desc *panel_dpi_probe(struct device *dev) { struct display_timing *timing; const struct device_node *np; struct panel_desc *desc; @@ -590,15 +588,21 @@ static const struct panel_desc *panel_simple_get_desc= (struct device *dev) =20 if (dev_is_platform(dev)) { const struct panel_desc *desc; =20 desc =3D of_device_get_match_data(dev); - if (!desc) - return ERR_PTR(-ENODEV); - - if (desc =3D=3D &panel_dpi) - return panel_dpi_probe(dev); + if (!desc) { + /* + * panel-dpi probes without a descriptor and + * panel_dpi_probe() will initialize one for us + * based on the device tree. + */ + if (of_device_is_compatible(dev->of_node, "panel-dpi")) + return panel_dpi_probe(dev); + else + return ERR_PTR(-ENODEV); + } =20 return desc; } =20 return ERR_PTR(-ENODEV); @@ -648,11 +652,11 @@ static struct panel_simple *panel_simple_probe(struct= device *dev) =20 if (!panel->ddc) return ERR_PTR(-EPROBE_DEFER); } =20 - if ((desc !=3D &panel_dpi) && + if (!of_device_is_compatible(dev->of_node, "panel-dpi") && !of_get_display_timing(dev->of_node, "panel-timing", &dt)) panel_simple_parse_panel_timing_node(dev, panel, &dt); =20 if (desc->connector_type =3D=3D DRM_MODE_CONNECTOR_LVDS) { /* Optional data-mapping property for overriding bus format */ @@ -5397,11 +5401,16 @@ static const struct of_device_id platform_of_match[= ] =3D { .compatible =3D "microchip,ac69t88a", .data =3D &mchp_ac69t88a, }, { /* Must be the last entry */ .compatible =3D "panel-dpi", - .data =3D &panel_dpi, + + /* + * Explicitly NULL, the panel_desc structure will be + * allocated by panel_dpi_probe(). + */ + .data =3D NULL, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, platform_of_match); --=20 2.49.0