Message ID | 20250206-hotplug-drm-bridge-v6-4-9d6f2c9c3058@bootlin.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add support for hot-pluggable DRM bridges | expand |
On Thu, Feb 06, 2025 at 07:14:19PM +0100, Luca Ceresoli wrote: > This function is for panel_bridge instances only. The silent return when > invoked on other bridges might hide actual errors, so avoid them to go > unnoticed. Is there a real case of something using this function in a wrong way? > > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> > > --- > > This patch was added in v6. > --- > drivers/gpu/drm/bridge/panel.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c > index 0c5db13b11dcb90ee88b9932b91aa05fc48d59bd..c57036b06493a6922e2cae38bcd1733930ff0073 100644 > --- a/drivers/gpu/drm/bridge/panel.c > +++ b/drivers/gpu/drm/bridge/panel.c > @@ -322,8 +322,10 @@ void drm_panel_bridge_remove(struct drm_bridge *bridge) > if (!bridge) > return; > > - if (!drm_bridge_is_panel(bridge)) > + if (!drm_bridge_is_panel(bridge)) { > + drm_warn(bridge->dev, "%s: called on non-panel bridge!\n", __func__); > return; > + } > > panel_bridge = drm_bridge_to_panel_bridge(bridge); > > > -- > 2.34.1 >
On Thu, 6 Feb 2025 19:14:19 +0100, Luca Ceresoli wrote: > This function is for panel_bridge instances only. The silent return when > invoked on other bridges might hide actual errors, so avoid them to go > unnoticed. > > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> > > [ ... ] Reviewed-by: Maxime Ripard <mripard@kernel.org> Thanks! Maxime
On Fri, 7 Feb 2025 04:22:25 +0200 Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote: > On Thu, Feb 06, 2025 at 07:14:19PM +0100, Luca Ceresoli wrote: > > This function is for panel_bridge instances only. The silent return when > > invoked on other bridges might hide actual errors, so avoid them to go > > unnoticed. > > Is there a real case of something using this function in a wrong way? I don't know, but there was one in my v5 code. Having this warning would have saved me a lot of debugging, so it looked useful for future developers. Luca
diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 0c5db13b11dcb90ee88b9932b91aa05fc48d59bd..c57036b06493a6922e2cae38bcd1733930ff0073 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -322,8 +322,10 @@ void drm_panel_bridge_remove(struct drm_bridge *bridge) if (!bridge) return; - if (!drm_bridge_is_panel(bridge)) + if (!drm_bridge_is_panel(bridge)) { + drm_warn(bridge->dev, "%s: called on non-panel bridge!\n", __func__); return; + } panel_bridge = drm_bridge_to_panel_bridge(bridge);
This function is for panel_bridge instances only. The silent return when invoked on other bridges might hide actual errors, so avoid them to go unnoticed. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> --- This patch was added in v6. --- drivers/gpu/drm/bridge/panel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)