From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: Jernej Skrabec <jernej.skrabec@siol.net>,
drinkcat@chromium.org, Jonas Karlman <jonas@kwiboo.se>,
David Airlie <airlied@linux.ie>,
Neil Armstrong <narmstrong@baylibre.com>,
dri-devel@lists.freedesktop.org,
Andrzej Hajda <a.hajda@samsung.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
hsinyi@chromium.org, matthias.bgg@gmail.com,
Collabora Kernel ML <kernel@collabora.com>,
sam@ravnborg.org
Subject: [PATCH v2 4/5] drm/bridge: ps8640: Print an error if VDO control fails
Date: Wed, 26 Aug 2020 10:15:25 +0200 [thread overview]
Message-ID: <20200826081526.674866-5-enric.balletbo@collabora.com> (raw)
In-Reply-To: <20200826081526.674866-1-enric.balletbo@collabora.com>
Print an error message inside ps8640_bridge_vdo_control() function when
it fails so we can simplify a bit the callers, they will only need to
check the error code.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
Changes in v2: None
drivers/gpu/drm/bridge/parade-ps8640.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c
index ce3e8b2da8c9..9f7b7a9c53c5 100644
--- a/drivers/gpu/drm/bridge/parade-ps8640.c
+++ b/drivers/gpu/drm/bridge/parade-ps8640.c
@@ -82,8 +82,11 @@ static int ps8640_bridge_vdo_control(struct ps8640 *ps_bridge,
ret = i2c_smbus_write_i2c_block_data(client, PAGE3_SET_ADD,
sizeof(vdo_ctrl_buf),
vdo_ctrl_buf);
- if (ret < 0)
+ if (ret < 0) {
+ DRM_ERROR("failed to %sable VDO: %d\n",
+ ctrl == ENABLE ? "en" : "dis", ret);
return ret;
+ }
return 0;
}
@@ -150,10 +153,8 @@ static void ps8640_pre_enable(struct drm_bridge *bridge)
}
ret = ps8640_bridge_vdo_control(ps_bridge, ENABLE);
- if (ret) {
- DRM_ERROR("failed to enable VDO: %d\n", ret);
+ if (ret)
goto err_regulators_disable;
- }
/* Switch access edp panel's edid through i2c */
ret = i2c_smbus_write_byte_data(client, PAGE2_I2C_BYPASS,
@@ -175,9 +176,7 @@ static void ps8640_post_disable(struct drm_bridge *bridge)
struct ps8640 *ps_bridge = bridge_to_ps8640(bridge);
int ret;
- ret = ps8640_bridge_vdo_control(ps_bridge, DISABLE);
- if (ret < 0)
- DRM_ERROR("failed to disable VDO: %d\n", ret);
+ ps8640_bridge_vdo_control(ps_bridge, DISABLE);
gpiod_set_value(ps_bridge->gpio_reset, 1);
gpiod_set_value(ps_bridge->gpio_powerdown, 1);
--
2.28.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-08-27 6:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 8:15 [PATCH v2 0/5] drm/bridge: ps8640: Make sure all needed is powered to get the EDID Enric Balletbo i Serra
2020-08-26 8:15 ` [PATCH v2 1/5] drm/bridge_connector: Set default status connected for eDP connectors Enric Balletbo i Serra
2020-08-26 12:37 ` Bilal Wasim
2020-08-26 8:15 ` [PATCH v2 2/5] drm/bridge: ps8640: Get the EDID from eDP control Enric Balletbo i Serra
2020-08-26 8:15 ` [PATCH v2 3/5] drm/bridge: ps8640: Return an error for incorrect attach flags Enric Balletbo i Serra
2020-08-26 12:45 ` Bilal Wasim
2020-08-26 8:15 ` Enric Balletbo i Serra [this message]
2020-08-26 12:45 ` [PATCH v2 4/5] drm/bridge: ps8640: Print an error if VDO control fails Bilal Wasim
2020-08-26 8:15 ` [PATCH v2 5/5] drm/bridge: ps8640: Rework power state handling Enric Balletbo i Serra
2020-08-26 13:04 ` Bilal Wasim
2020-08-26 18:46 ` Sam Ravnborg
2020-08-27 8:15 ` Enric Balletbo i Serra
2020-08-26 17:20 ` [PATCH v2 0/5] drm/bridge: ps8640: Make sure all needed is powered to get the EDID Sam Ravnborg
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=20200826081526.674866-5-enric.balletbo@collabora.com \
--to=enric.balletbo@collabora.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=drinkcat@chromium.org \
--cc=hsinyi@chromium.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=narmstrong@baylibre.com \
--cc=sam@ravnborg.org \
/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).