linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: Maxime Ripard <mripard@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Anusha Srivatsa <asrivats@redhat.com>,
	Francesco Dolcini <francesco@dolcini.it>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Maxime Ripard <mripard@kernel.org>
Subject: Re: [PATCH v2 1/5] drm/mipi-dsi: Add dev_is_mipi_dsi function
Date: Fri, 27 Jun 2025 11:04:16 +0200	[thread overview]
Message-ID: <87cyapd08f.fsf@minerva.mail-host-address-is-not-set> (raw)
In-Reply-To: <20250626-drm-panel-simple-fixes-v2-1-5afcaa608bdc@kernel.org>

Maxime Ripard <mripard@kernel.org> writes:

Hello Maxime,

> 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 <mripard@kernel.org>
> ---
>  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..21fd647f8ce1a6a862e2f8fb5320e701f26f614f 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 = {
>  	.thaw = pm_generic_thaw,
>  	.poweroff = pm_generic_poweroff,
>  	.restore = pm_generic_restore,
>  };
>  
> -static const struct bus_type mipi_dsi_bus_type = {
> +const struct bus_type mipi_dsi_bus_type = {
>  	.name = "mipi-dsi",
>  	.match = mipi_dsi_device_match,
>  	.uevent = mipi_dsi_uevent,
>  	.pm = &mipi_dsi_device_pm_ops,
>  };
> +EXPORT_SYMBOL_GPL(mipi_dsi_bus_type);
>  
>  /**
>   * 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..6d2c08e8110151a97620389197f1ef79c058329d 100644
> --- a/include/drm/drm_mipi_dsi.h
> +++ b/include/drm/drm_mipi_dsi.h
> @@ -221,10 +221,13 @@ struct mipi_dsi_multi_context {
>  
>  #define MIPI_DSI_MODULE_PREFIX "mipi-dsi:"
>  
>  #define to_mipi_dsi_device(__dev)	container_of_const(__dev, struct mipi_dsi_device, dev)
>  
> +extern const struct bus_type mipi_dsi_bus_type;
> +#define dev_is_mipi_dsi(dev)	((dev)->bus == &mipi_dsi_bus_type)
> +

Usually I prefer to have static inline functions instead of macros to have
type checking. I see that this header has a mix of both, so I don't have a
strong opinion on what to use in this case.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


  reply	other threads:[~2025-06-27  9:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 10:04 [PATCH v2 0/5] drm/panel: panel-simple: Fix panel-dpi probe error Maxime Ripard
2025-06-26 10:04 ` [PATCH v2 1/5] drm/mipi-dsi: Add dev_is_mipi_dsi function Maxime Ripard
2025-06-27  9:04   ` Javier Martinez Canillas [this message]
2025-06-27  9:25     ` Maxime Ripard
2025-06-27  9:34       ` Javier Martinez Canillas
2025-06-26 10:05 ` [PATCH v2 2/5] drm/panel: panel-simple: make panel_dpi_probe return a panel_desc Maxime Ripard
2025-06-27  9:06   ` Javier Martinez Canillas
2025-06-26 10:05 ` [PATCH v2 3/5] drm/panel: panel-simple: Make panel_simple_probe return its panel Maxime Ripard
2025-06-27  9:10   ` Javier Martinez Canillas
2025-06-26 10:05 ` [PATCH v2 4/5] drm/panel: panel-simple: Add function to look panel data up Maxime Ripard
2025-06-27  9:12   ` Javier Martinez Canillas
2025-06-26 10:05 ` [PATCH v2 5/5] drm/panel: panel-simple: get rid of panel_dpi hack Maxime Ripard
2025-06-27  9:13   ` Javier Martinez Canillas
2025-06-26 10:21 ` [PATCH v2 0/5] drm/panel: panel-simple: Fix panel-dpi probe error Francesco Dolcini
2025-06-27  9:24   ` Maxime Ripard
2025-06-27  9:24 ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cyapd08f.fsf@minerva.mail-host-address-is-not-set \
    --to=javierm@redhat.com \
    --cc=airlied@gmail.com \
    --cc=asrivats@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francesco@dolcini.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_jesszhan@quicinc.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).