From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giulio Benetti Date: Sun, 14 Feb 2021 03:05:40 +0100 Subject: [PATCH] clk: fix clk_get_rate() documentation In-Reply-To: References: <923AE82E-B5EF-4247-A439-E3B782CDFCD3@benettiengineering.com> Message-ID: <4954d2c9-cc77-872d-9159-8148fe7ebd7b@benettiengineering.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 2/13/21 7:24 PM, Simon Glass wrote: > Hi Giulio, > > On Sat, 13 Feb 2021 at 01:47, Giulio Benetti > wrote: >> >> Hi Simon, Sean, >> >>> Il giorno 13 feb 2021, alle ore 05:17, Simon Glass ha scritto: >>> >>> ?On Fri, 12 Feb 2021 at 18:17, Giulio Benetti >>> wrote: >>>> >>>>> On 2/13/21 12:25 AM, Sean Anderson wrote: >>>>> On 2/10/21 12:37 PM, Giulio Benetti wrote: >>>>>> clk_get_rate() can't and doesn't return -ve on error, it actually returns 0 >>>>>> on error or a value greater than 0 on success. So let's fix its >>>>>> documentation. >>>>>> >>>>>> Signed-off-by: Giulio Benetti >>>>>> --- >>>>>> include/clk.h | 2 +- >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> Reviewed-by: Simon Glass >> >> Sean has already given me a NAK because this function actually return negative values through a ulong return types. >> I didn?t check into clk-uclass.c and there if get_rate() pointer is not found then it returns a negative value. > > Yes, wrong email...see below. > >> >> Since it?s a bit ambiguous I?ve tried to find a different approach but nothing that easy came into my mind. > > Something like this: > > * @return clock rate in Hz, 0 for invalid clock, or -ve error code for > other error That's a good idea Simon, thank you, going to send patch for it soon. Kind regards -- Giulio Benetti Benetti Engineering sas