lkml.org 
[lkml]   [2016]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pwm: Fix of_pwm_get() for consistent return values
On Sun, Nov 29, 2015 at 02:17:37PM +0100, Alban Bedel wrote:
> When of_pwm_get() is called without connection ID it returns
> -ENOENT when the 'pwms' property doesn't exists or is an empty entry.
> However when a connection ID is given and the 'pwm-names' property
> doesn't exists or doesn't contains the requested name it returns
> -ENODATA or -EINVAL.
>
> To get a consistent return value with both code paths we must return
> -ENOENT when of_property_match_string() fails.

I'm not sure I understand the need for a consistent return value here.
These are all different error conditions and the only reasonable thing
to do here is propagate the error code from the of_*() parsing routine
that is being called.

Thierry
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-01-04 09:41    [W:0.078 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site