Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1300538

Re: [PATCH] pwm: Fix of_pwm_get() for consistent return values

From Thierry Reding <thierry.reding@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] pwm: Fix of_pwm_get() for consistent return values
Date 2016-01-04 09:20 +0100
Message-ID <qN8wW-VH-11@gated-at.bofh.it> (permalink)
References <qAa3v-6CS-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] pwm: Fix of_pwm_get() for consistent return values Thierry Reding <thierry.reding@gmail.com> - 2016-01-04 09:20 +0100
  Re: [PATCH] pwm: Fix of_pwm_get() for consistent return values Alban <albeu@free.fr> - 2016-01-04 15:00 +0100

csiph-web