Re: [PATCH] iio: pressure: add support for MS5611 pressure and temperature sensor

From: tduszyns
Date: Mon Mar 09 2015 - 15:06:06 EST


On Sun, Mar 08, 2015 at 09:11:07PM +0200, Daniel Baluta wrote:
> Hi Tomasz,
>
> On Sun, Mar 8, 2015 at 7:29 PM, Tomasz Duszynski <tduszyns@xxxxxxxxx> wrote:
> > Add support for Measurement Specialities MS5611 pressure
> > and temperature sensor.
> >
> > Signed-off-by: Tomasz Duszynski <tduszyns@xxxxxxxxx>
>
> <snip>
>
> > +++ b/drivers/iio/pressure/ms5611_i2c.c
> > @@ -0,0 +1,131 @@
> > +/*
> > + * MS5611 pressure and temperature sensor driver (I2C bus)
> > + *
> > + * Copyright (c) Tomasz Duszynski <tduszyns@xxxxxxxxx>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + *
>
> If fixed, please specify here the I2C slave address.
OK
>
> > + */
> > +#include <linux/delay.h>
>
> <snip>
>
> > +static int ms5611_read_adc(struct ms5611_state *st, s32 *val)
> > +{
> > + int ret;
> > + u8 buf[3];
> > +
> > + ret = i2c_smbus_read_i2c_block_data(st->client, MS5611_READ_ADC,
> > + 3, buf);
> > + if (ret < 0)
> > + return ret;
> > +
> > + *val = (buf[0] << 16) | (buf[1] << 8) | buf[0];
>
> Hmm, buf[2] is not used. Is this intended or the formula
> has buf[2] as the last OR factor?
You're right. Last factor should be buf[2].
>
> thanks,
> Daniel.

Thanks for review!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/