Message ID | 20210307140626.22699-1-paul@crapouillou.net (mailing list archive) |
---|---|
State | Rejected, archived |
Headers | show |
Series | clk: Fix doc of clk_get_parent | expand |
On Sun, Mar 07, 2021 at 02:06:26PM +0000, Paul Cercueil wrote: > On error, or when the passed parameter is NULL, the return value is NULL > and not a PTR_ERR()-encoded value. No, the documentation is accurate. The CCF is just an implementation of the API, the file you are modifying is the definitive API documentation.
Hi, Le dim. 7 mars 2021 à 14:27, Russell King - ARM Linux admin <linux@armlinux.org.uk> a écrit : > On Sun, Mar 07, 2021 at 02:06:26PM +0000, Paul Cercueil wrote: >> On error, or when the passed parameter is NULL, the return value is >> NULL >> and not a PTR_ERR()-encoded value. > > No, the documentation is accurate. The CCF is just an implementation > of the API, the file you are modifying is the definitive API > documentation. Well, then the code has to be fixed, because right now it returns NULL on error, since the 2.6 days. Cheers, -Paul
On Sun, Mar 07, 2021 at 02:29:07PM +0000, Paul Cercueil wrote: > Hi, > > Le dim. 7 mars 2021 à 14:27, Russell King - ARM Linux admin > <linux@armlinux.org.uk> a écrit : > > On Sun, Mar 07, 2021 at 02:06:26PM +0000, Paul Cercueil wrote: > > > On error, or when the passed parameter is NULL, the return value is > > > NULL > > > and not a PTR_ERR()-encoded value. > > > > No, the documentation is accurate. The CCF is just an implementation > > of the API, the file you are modifying is the definitive API > > documentation. > > Well, then the code has to be fixed, because right now it returns NULL on > error, since the 2.6 days. And you consider NULL to be an error? A NULL clock isn't defined to be an error by the API.
Le dim. 7 mars 2021 à 14:30, Russell King - ARM Linux admin <linux@armlinux.org.uk> a écrit : > On Sun, Mar 07, 2021 at 02:29:07PM +0000, Paul Cercueil wrote: >> Hi, >> >> Le dim. 7 mars 2021 à 14:27, Russell King - ARM Linux admin >> <linux@armlinux.org.uk> a écrit : >> > On Sun, Mar 07, 2021 at 02:06:26PM +0000, Paul Cercueil wrote: >> > > On error, or when the passed parameter is NULL, the return >> value is >> > > NULL >> > > and not a PTR_ERR()-encoded value. >> > >> > No, the documentation is accurate. The CCF is just an >> implementation >> > of the API, the file you are modifying is the definitive API >> > documentation. >> >> Well, then the code has to be fixed, because right now it returns >> NULL on >> error, since the 2.6 days. > > And you consider NULL to be an error? A NULL clock isn't defined to be > an error by the API. Fair enough. Ignore my patch then. Cheers, -Paul
diff --git a/include/linux/clk.h b/include/linux/clk.h index 266e8de3cb51..96031b5f6933 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -745,7 +745,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent); * @clk: clock source * * Returns struct clk corresponding to parent clock source, or - * valid IS_ERR() condition containing errno. + * NULL on error. */ struct clk *clk_get_parent(struct clk *clk);
On error, or when the passed parameter is NULL, the return value is NULL and not a PTR_ERR()-encoded value. Signed-off-by: Paul Cercueil <paul@crapouillou.net> --- include/linux/clk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)