summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-11-02 19:56:45 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2023-11-21 11:17:51 +0300
commitbe79252e7c83885bd0043168954b8400a42153ed (patch)
tree6934b6eacaac1072c63bbbd029e789c55d18438e
parentb47914741a80f59483cba0b59c43a92c01bc4b2f (diff)
downloadlinux-be79252e7c83885bd0043168954b8400a42153ed.tar.xz
drm/bridge: cdns-mhdp8546: Improve error reporting in remove callback
Replace the generic error message issued by the driver core when the remove callback returns non-zero ("remove callback returned a non-zero value. This will be ignored.") by a message that tells the actual problem. Also simplify a bit by checking the return value of wait_event_timeout a bit later. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20231102165640.3307820-22-u.kleine-koenig@pengutronix.de
-rw-r--r--drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index 6af565ac307a..66c87d36ce51 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -2600,7 +2600,6 @@ static int cdns_mhdp_remove(struct platform_device *pdev)
{
struct cdns_mhdp_device *mhdp = platform_get_drvdata(pdev);
unsigned long timeout = msecs_to_jiffies(100);
- bool stop_fw = false;
int ret;
drm_bridge_remove(&mhdp->bridge);
@@ -2608,18 +2607,19 @@ static int cdns_mhdp_remove(struct platform_device *pdev)
ret = wait_event_timeout(mhdp->fw_load_wq,
mhdp->hw_state == MHDP_HW_READY,
timeout);
- if (ret == 0)
- dev_err(mhdp->dev, "%s: Timeout waiting for fw loading\n",
- __func__);
- else
- stop_fw = true;
-
spin_lock(&mhdp->start_lock);
mhdp->hw_state = MHDP_HW_STOPPED;
spin_unlock(&mhdp->start_lock);
- if (stop_fw)
+ if (ret == 0) {
+ dev_err(mhdp->dev, "%s: Timeout waiting for fw loading\n",
+ __func__);
+ } else {
ret = cdns_mhdp_set_firmware_active(mhdp, false);
+ if (ret)
+ dev_err(mhdp->dev, "Failed to stop firmware (%pe)\n",
+ ERR_PTR(ret));
+ }
phy_exit(mhdp->phy);
@@ -2635,7 +2635,7 @@ static int cdns_mhdp_remove(struct platform_device *pdev)
clk_disable_unprepare(mhdp->clk);
- return ret;
+ return 0;
}
static const struct of_device_id mhdp_ids[] = {