All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick DELAUNAY <patrick.delaunay@st.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/5] dm: clk: add stub for clk_disable_bulk when CONFIG_CLK is desactivated
Date: Wed, 20 Nov 2019 10:04:27 +0000	[thread overview]
Message-ID: <94c7cac6ac444640a09b091589fdd900@SFHDAG6NODE3.st.com> (raw)
In-Reply-To: <CAAh8qsyBv4i+mbMMNe5c3Nu-wjY=+EhO6xQ5Ukpcr3rziNUuWQ@mail.gmail.com>

Hi Simon

>De : Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
>Envoyé : mardi 12 novembre 2019 11:40
>
>
>Patrick Delaunay <patrick.delaunay@st.com> schrieb am Di., 12. Nov. 2019, 10:42:
>Add stub for clk_disable_bulk() when CONFIG_CLK is desactivated.
>
>That avoid compilation issue (undefined reference to
>`clk_disable_bulk') for code:
>
>clk_disable_bulk(&priv->clks);
>clk_release_bulk(&priv->clks);
>
>Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
>---
>
>Changes in v3:
>- Add stub for clk_disable_bulk
>
>Changes in v2: None
>
> include/clk.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/include/clk.h b/include/clk.h
>index a5ee53d94a..6f0b0fe4bc 100644
>--- a/include/clk.h
>+++ b/include/clk.h
>@@ -379,7 +379,11 @@ int clk_disable(struct clk *clk);
>  *             by clk_get_bulk().
>  * @return zero on success, or -ve error code.
>  */
>+ #if CONFIG_IS_ENABLED(CLK)
> int clk_disable_bulk(struct clk_bulk *bulk);
>+#else
>+inline int clk_disable_bulk(struct clk_bulk *bulk) { return 0; }
>+#endif
>
>Doing this inline at this place seems quite different than what is done for the other functions?

which functions ?

I see:

static inline int clk_get_by_index(struct udevice *dev, int index,
   struct clk *clk)
{
return -ENOSYS;
}

static inline int clk_set_defaults(struct udevice *dev)
{
return 0;
}

But I agree, that it is a simplified stub....

Disable clk bulk if OK only if bulk.count ==0 but if should be always
the case if CONFIG_CLK is disabled (as clk_get_bulk return -ENOSYS).

A more complete (better ?) stub is :

inline int clk_disable_bulk(struct clk_bulk *bulk) {
if (bulk && bulk->count == 0) return 0;
else return -ENOSYS;
}

I think about a other solution:

inline int clk_disable_bulk(struct clk_bulk *bulk) {
return -ENOSYS;
}

But that cause issue if the return value is tested by caller.

ret = clk_disable_bulk(bulk)
if (ret)
            return ret;

>Regards,
>Simon

Regards
Patrick

>
> /**
>  * clk_is_match - check if two clk's point to the same hardware clock
>--
>2.17.1
>

  reply	other threads:[~2019-11-20 10:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12  9:42 [U-Boot] [PATCH v3 0/5] usb: host: dwc2: use driver model for PHY and CLOCK Patrick Delaunay
2019-11-12  9:42 ` [U-Boot] [PATCH v3 1/5] dm: clk: add stub for clk_disable_bulk when CONFIG_CLK is desactivated Patrick Delaunay
2019-11-12 10:16   ` Jean-Jacques Hiblot
2019-11-12 15:47     ` Patrick DELAUNAY
2019-11-12 10:40   ` Simon Goldschmidt
2019-11-20 10:04     ` Patrick DELAUNAY [this message]
2019-11-12  9:42 ` [U-Boot] [PATCH v3 2/5] usb: host: dwc2: add phy support Patrick Delaunay
2019-11-12  9:42 ` [U-Boot] [PATCH v3 3/5] usb: host: dwc2: add clk support Patrick Delaunay
2019-11-12  9:42 ` [U-Boot] [PATCH v3 4/5] usb: host: dwc2: force reset assert Patrick Delaunay
2019-11-12  9:42 ` [U-Boot] [PATCH v3 5/5] usb: host: dwc2: add trace to have clean usb start Patrick Delaunay
2020-02-14 13:34 ` [PATCH v3 0/5] usb: host: dwc2: use driver model for PHY and CLOCK Patrick DELAUNAY
2020-02-14 18:29   ` Marek Vasut

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=94c7cac6ac444640a09b091589fdd900@SFHDAG6NODE3.st.com \
    --to=patrick.delaunay@st.com \
    --cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.