This looks basically sound but I would fix one thing

> +static int set_reg(struct i2c_client *client, u8 reg, u8 mask, u8
> value,
> +                  u8 offset)
> +{
> +       u8 tmp;
> +
> +       mutex_lock(&i2c_mutex);
> +
> +       tmp = i2c_smbus_read_byte_data(client, reg);

i2c_smbus_read_byte_data/write_byte_data can also return error codes so
I would actually check them

ie
        int tmp;

        tmp = i2c_smbus_read_byte_data(client, reg);
        if (tmp < 0) {
                dev_err(.....)
                return tmp;
        }


>
> +       set_reg(client, LM3555_ITR, LM3555_ITR_IC, value, 6);
> +
> +       return 0;

And these bits would all become

        return set_reg(.....);


Alan
_______________________________________________
Meego-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to