From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 7/8] net: phy: Add support to configure clock in Broadcom iProc mdio mux
Date: Wed, 1 Aug 2018 22:38:46 +0200 [thread overview]
Message-ID: <20180801203846.GE19257@lunn.ch> (raw)
In-Reply-To: <20180801202313.GH30658@n2100.armlinux.org.uk>
On Wed, Aug 01, 2018 at 09:23:14PM +0100, Russell King - ARM Linux wrote:
> On Wed, Aug 01, 2018 at 10:07:12PM +0200, Andrew Lunn wrote:
> > You might want to consider adding clk_optional_get() and
> > devm_clk_optional_get().
>
> I think there's attempts to add such APIs but I don't think it's
> trivial - it seems to require a _lot_ of discussion.
>
> I think part of that is because of the quirky use of error codes.
> If you look at clk_get(), it calls __of_clk_get_by_name() which
> returns:
>
> -ENOENT if DT is disabled
> -ENOENT if the device has no DT node
> -EPROBE_DEFER if the lookup in DT succeeds but there's no registered
> clock
> -EINVAL if the device has a DT node but the lookup of the name
> failed (in otherwords, the optional clock was omitted)
> -ENOENT if the clocks = property has not enough clocks for the
> clock-names property
> -ENOMEM if we fail to allocate the clk
> -ENOENT if __clk_get() fails
That makes it hard. I added phy_optional_get() early on, when the
error cases were simple. Hopefully they remain simple...
Andrew
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: Arun Parameswaran <arun.parameswaran@broadcom.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>, Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>,
netdev@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 7/8] net: phy: Add support to configure clock in Broadcom iProc mdio mux
Date: Wed, 1 Aug 2018 22:38:46 +0200 [thread overview]
Message-ID: <20180801203846.GE19257@lunn.ch> (raw)
In-Reply-To: <20180801202313.GH30658@n2100.armlinux.org.uk>
On Wed, Aug 01, 2018 at 09:23:14PM +0100, Russell King - ARM Linux wrote:
> On Wed, Aug 01, 2018 at 10:07:12PM +0200, Andrew Lunn wrote:
> > You might want to consider adding clk_optional_get() and
> > devm_clk_optional_get().
>
> I think there's attempts to add such APIs but I don't think it's
> trivial - it seems to require a _lot_ of discussion.
>
> I think part of that is because of the quirky use of error codes.
> If you look at clk_get(), it calls __of_clk_get_by_name() which
> returns:
>
> -ENOENT if DT is disabled
> -ENOENT if the device has no DT node
> -EPROBE_DEFER if the lookup in DT succeeds but there's no registered
> clock
> -EINVAL if the device has a DT node but the lookup of the name
> failed (in otherwords, the optional clock was omitted)
> -ENOENT if the clocks = property has not enough clocks for the
> clock-names property
> -ENOMEM if we fail to allocate the clk
> -ENOENT if __clk_get() fails
That makes it hard. I added phy_optional_get() early on, when the
error cases were simple. Hopefully they remain simple...
Andrew
next prev parent reply other threads:[~2018-08-01 20:38 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-01 17:56 [PATCH v3 0/8] Add clock config and pm support to bcm iProc mdio mux Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 17:56 ` [PATCH v3 1/8] dt-bindings: net: Fix Broadcom iProc mdio mux driver base address Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 17:56 ` [PATCH v3 2/8] net: phy: Fix the register offsets in Broadcom iProc mdio mux driver Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 17:56 ` [PATCH v3 3/8] arm64: dts: Fix the base address of the Broadcom iProc mdio mux Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 17:56 ` [PATCH v3 4/8] net: phy: Disable external master access in bcm mdio mux driver Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 17:56 ` [PATCH v3 5/8] net: phy: Use devm api for mdio bus allocation in bcm iproc mdio mux Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 18:37 ` Florian Fainelli
2018-08-01 18:37 ` Florian Fainelli
2018-08-01 17:56 ` [PATCH v3 6/8] dt-bindings: net: Add clock handle to Broadcom iProc " Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 17:56 ` [PATCH v3 7/8] net: phy: Add support to configure clock in " Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 18:40 ` Florian Fainelli
2018-08-01 18:40 ` Florian Fainelli
2018-08-01 18:46 ` Russell King - ARM Linux
2018-08-01 18:46 ` Russell King - ARM Linux
2018-08-01 19:55 ` Arun Parameswaran
2018-08-01 19:55 ` Arun Parameswaran
2018-08-01 20:07 ` Andrew Lunn
2018-08-01 20:07 ` Andrew Lunn
2018-08-01 20:23 ` Russell King - ARM Linux
2018-08-01 20:23 ` Russell King - ARM Linux
2018-08-01 20:38 ` Andrew Lunn [this message]
2018-08-01 20:38 ` Andrew Lunn
2018-08-01 21:45 ` Arun Parameswaran
2018-08-01 21:45 ` Arun Parameswaran
2018-08-01 21:55 ` Andrew Lunn
2018-08-01 21:55 ` Andrew Lunn
2018-08-01 22:10 ` Arun Parameswaran
2018-08-01 22:10 ` Arun Parameswaran
2018-08-01 22:18 ` Andrew Lunn
2018-08-01 22:18 ` Andrew Lunn
2018-08-01 17:56 ` [PATCH v3 8/8] net: phy: Add pm support to Broadcom iProc mdio mux driver Arun Parameswaran
2018-08-01 17:56 ` Arun Parameswaran
2018-08-01 18:39 ` Florian Fainelli
2018-08-01 18:39 ` Florian Fainelli
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=20180801203846.GE19257@lunn.ch \
--to=andrew@lunn.ch \
--cc=linux-arm-kernel@lists.infradead.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 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.