lkml.org 
[lkml]   [2018]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] regulator: Fix return type of of_map_mode()
Hi,

On Tue, Apr 17, 2018 at 10:48 AM, Javier Martinez Canillas
<javier@dowhile0.org> wrote:
>>> Let's fix the return type of all of the current of_map_mode()
>>> functions. While we're at it, we'll remove one pointless "inline".
>>
>> Ah, I see... the thing here is that the mode is always an unsigned int
>> since it's a bitmask - this goes out beying the use in of_map_mode() and
>> into all the other APIs. We only actually use 4 bits currently so I
>> think there's no problem switching to int but it seems we should
>> probably do that consistently throughout the API so that things don't
>> get missed later on.
>
> Maybe another option could be to add a REGULATOR_MODE_INVALID with
> value 0x0, and fix the drivers that are returning -EINVAL to return
> that instead?
>
> In of_get_regulation_constraints() we could check for that and
> propagate -EINVAL.

I like this idea. Posted at
<https://patchwork.kernel.org/patch/10347345/>. Note that there's no
actual error to propagate since of_get_regulation_constraints() just
prints the error and continues on its merry way.

-Doug

\
 
 \ /
  Last update: 2018-04-18 05:36    [W:0.950 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site