From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Douglas Anderson <dianders@chromium.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
Neil Armstrong <narmstrong@baylibre.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@siol.net>,
Sam Ravnborg <sam@ravnborg.org>,
Stephen Boyd <swboyd@chromium.org>,
linux-arm-msm@vger.kernel.org, robdclark@chromium.org,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] drm/bridge: ti-sn65dsi86: Simplify refclk handling
Date: Sat, 13 Mar 2021 23:02:34 +0200 [thread overview]
Message-ID: <YE0oakt4h3urAsH1@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210304155144.1.Ic9c04f960190faad5290738b2a35d73661862735@changeid>
Hi Douglas,
Thank you for the patch.
On Thu, Mar 04, 2021 at 03:51:59PM -0800, Douglas Anderson wrote:
> The clock framework makes it simple to deal with an optional clock.
> You can call clk_get_optional() and if the clock isn't specified it'll
> just return NULL without complaint. It's valid to pass NULL to
> enable/disable/prepare/unprepare. Let's make use of this to simplify
> things a tiny bit.
>
> NOTE: this makes things look a tad bit asymmetric now since we check
> for NULL before clk_prepare_enable() but not for
> clk_disable_unprepare(). This seemed OK to me. We already have to
> check for NULL in the enable case anyway so why not avoid the extra
> call?
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>
> drivers/gpu/drm/bridge/ti-sn65dsi86.c | 11 +++--------
> 1 file changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> index f27306c51e4d..942019842ff4 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c
> @@ -1261,14 +1261,9 @@ static int ti_sn_bridge_probe(struct i2c_client *client,
> return ret;
> }
>
> - pdata->refclk = devm_clk_get(pdata->dev, "refclk");
> - if (IS_ERR(pdata->refclk)) {
> - ret = PTR_ERR(pdata->refclk);
> - if (ret == -EPROBE_DEFER)
> - return ret;
> - DRM_DEBUG_KMS("refclk not found\n");
> - pdata->refclk = NULL;
> - }
> + pdata->refclk = devm_clk_get_optional(pdata->dev, "refclk");
> + if (IS_ERR(pdata->refclk))
> + return PTR_ERR(pdata->refclk);
>
> ret = ti_sn_bridge_parse_dsi_host(pdata);
> if (ret)
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2021-03-13 21:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 23:51 [PATCH 1/3] drm/bridge: ti-sn65dsi86: Simplify refclk handling Douglas Anderson
2021-03-04 23:52 ` [PATCH 2/3] drm/bridge: ti-sn65dsi86: Move code in prep for EDID read fix Douglas Anderson
2021-03-05 10:07 ` Robert Foss
2021-03-12 2:50 ` Bjorn Andersson
2021-03-13 20:25 ` Stephen Boyd
2021-03-13 21:12 ` Laurent Pinchart
2021-03-15 16:31 ` Doug Anderson
2021-03-15 16:41 ` Laurent Pinchart
2021-03-04 23:52 ` [PATCH 3/3] drm/bridge: ti-sn65dsi86: Properly get the EDID, but only if refclk Douglas Anderson
2021-03-12 2:59 ` Bjorn Andersson
2021-03-13 21:16 ` Laurent Pinchart
2021-03-15 16:25 ` Doug Anderson
2021-03-16 21:46 ` Laurent Pinchart
2021-03-17 0:44 ` Doug Anderson
2021-03-30 2:57 ` Doug Anderson
2021-03-30 3:19 ` Laurent Pinchart
2021-03-05 10:00 ` [PATCH 1/3] drm/bridge: ti-sn65dsi86: Simplify refclk handling Robert Foss
2021-03-12 2:49 ` Bjorn Andersson
2021-03-13 20:23 ` Stephen Boyd
2021-03-13 21:02 ` Laurent Pinchart [this message]
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=YE0oakt4h3urAsH1@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=robdclark@chromium.org \
--cc=sam@ravnborg.org \
--cc=swboyd@chromium.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).