linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] i2c_check_functionality and error code
@ 2016-02-14 23:09 Matt Ranostay
  2016-02-21 20:33 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Ranostay @ 2016-02-14 23:09 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio@vger.kernel.org

Jonathan et all,

Has anyone noticed that there is no clear consensus on which error
code to return when a i2c_check_functionality() check fails within the
probe function. I've seen so far ENODEV, ENOTSUPP, EOPNOTSUPP, EIO,
and ENOSYS in drivers/iio

Shouldn't these be made a standard value like -ENOTSUPP?

Thanks,

Matt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] i2c_check_functionality and error code
  2016-02-14 23:09 [RFC] i2c_check_functionality and error code Matt Ranostay
@ 2016-02-21 20:33 ` Jonathan Cameron
  2016-02-21 22:56   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2016-02-21 20:33 UTC (permalink / raw)
  To: Matt Ranostay, linux-iio@vger.kernel.org, Wolfram Sang, Linux I2C

On 14/02/16 23:09, Matt Ranostay wrote:
> Jonathan et all,
> 
> Has anyone noticed that there is no clear consensus on which error
> code to return when a i2c_check_functionality() check fails within the
> probe function. I've seen so far ENODEV, ENOTSUPP, EOPNOTSUPP, EIO,
> and ENOSYS in drivers/iio
> 
> Shouldn't these be made a standard value like -ENOTSUPP?
Would make sense - but is this the right choice.

Thought I'd grep HWMON as a possible source of a consensus on this and
got no clear answer.  The most common in there looks to be -ENODEV though
(From the first few pages of results anyway ;)

Hohum. Wolfram what do you think?

Worth cleaning this up?  Perhaps even kernel wise would lead to some
consistency. I've never been that sharp on this in IIO so I can't
really talk ;)

Jonathan


> 
> Thanks,
> 
> Matt
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] i2c_check_functionality and error code
  2016-02-21 20:33 ` Jonathan Cameron
@ 2016-02-21 22:56   ` Wolfram Sang
  2016-02-24 20:42     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2016-02-21 22:56 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Matt Ranostay, linux-iio@vger.kernel.org, Linux I2C

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

> Hohum. Wolfram what do you think?

I'd go for "EOPNOTSUPP" since it is most descriptive. I wouldn't say we
really need to fix it up in the kernel tree. However, I neither would
vote against it.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] i2c_check_functionality and error code
  2016-02-21 22:56   ` Wolfram Sang
@ 2016-02-24 20:42     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2016-02-24 20:42 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Matt Ranostay, linux-iio@vger.kernel.org, Linux I2C

On 21/02/16 22:56, Wolfram Sang wrote:
>> Hohum. Wolfram what do you think?
> 
> I'd go for "EOPNOTSUPP" since it is most descriptive. I wouldn't say we
> really need to fix it up in the kernel tree. However, I neither would
> vote against it.
> 
I'm certainly keen on cleaning this up in IIO at the least.
A bit of consistency is always nice and once we have done it once
it should be reasonably pain free.

Anyhow, patches welcome ;)

Jonathan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-24 20:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-14 23:09 [RFC] i2c_check_functionality and error code Matt Ranostay
2016-02-21 20:33 ` Jonathan Cameron
2016-02-21 22:56   ` Wolfram Sang
2016-02-24 20:42     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).