Re: [PATCH] Support for the pressure sensor BMP085 from Bosch Sensortec.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Cameron
Date: Sunday, June 20, 2010 - 4:00 am

On 06/20/10 01:27, Christoph Mair wrote:
Hi Christoph.

Couple more comments below.  One is a confusing comment in the code
that I missed before.  The others are again to do with error handling.

With the changes you made here any error results in sysfs reads returning
-EIO.  That is correct if not enough bytes are transmitted. However,
if something else goes wrong the i2c core may return an error code
and if it does, it is these error codes that should be passed on up to
user space. (so basically pass on any negative return values).

Fix these last few bits and I'm happy and you can add
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>

Nice clean little driver.

Conventionally return -EIO only if the length is wrong but no error send).  If you get an
error code (i.e. negative then return that directly).
Here you probably do want to add a check for a positive but incorrect
value and set status to -EIO if you get one.
Again, don't eat errors if they are coming up from the i2c core.
The comment above looks reversed to me? Or is it an extension of the one above?

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Support for the pressure sensor BMP085 from Bo ..., Jonathan Cameron, (Sun Jun 20, 4:00 am)
RE: [PATCH] Support for the pressure sensor BMP085 from Bo ..., Datta, Shubhrajyoti, (Sun Jun 20, 11:45 pm)
RE: [PATCH] Support for the pressure sensor BMP085 from Bo ..., Datta, Shubhrajyoti, (Mon Jun 21, 1:52 am)
bmp085: add inline and ABI documentation , Christoph Mair, (Sat Jun 26, 4:10 am)