iio: light: ltr501: Fix alignment to match open parenthesis
This makes ltr501 code consistent with the coding style adopted for the new drivers added to IIO. We prepare the path for adding support for LTR559 chip. Reported by checkpatch.pl Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
dee1f55057
commit
abda2b4f21
|
@ -77,7 +77,8 @@ static int ltr501_read_als(struct ltr501_data *data, __le16 buf[2])
|
|||
return ret;
|
||||
/* always read both ALS channels in given order */
|
||||
return i2c_smbus_read_i2c_block_data(data->client,
|
||||
LTR501_ALS_DATA1, 2 * sizeof(__le16), (u8 *) buf);
|
||||
LTR501_ALS_DATA1,
|
||||
2 * sizeof(__le16), (u8 *)buf);
|
||||
}
|
||||
|
||||
static int ltr501_read_ps(struct ltr501_data *data)
|
||||
|
@ -219,7 +220,8 @@ static int ltr501_write_raw(struct iio_dev *indio_dev,
|
|||
else
|
||||
return -EINVAL;
|
||||
return i2c_smbus_write_byte_data(data->client,
|
||||
LTR501_ALS_CONTR, data->als_contr);
|
||||
LTR501_ALS_CONTR,
|
||||
data->als_contr);
|
||||
case IIO_PROXIMITY:
|
||||
i = ltr501_get_ps_gain_index(val, val2);
|
||||
if (i < 0)
|
||||
|
@ -227,7 +229,8 @@ static int ltr501_write_raw(struct iio_dev *indio_dev,
|
|||
data->ps_contr &= ~LTR501_CONTR_PS_GAIN_MASK;
|
||||
data->ps_contr |= i << LTR501_CONTR_PS_GAIN_SHIFT;
|
||||
return i2c_smbus_write_byte_data(data->client,
|
||||
LTR501_PS_CONTR, data->ps_contr);
|
||||
LTR501_PS_CONTR,
|
||||
data->ps_contr);
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -290,7 +293,9 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p)
|
|||
|
||||
if (mask & LTR501_STATUS_ALS_RDY) {
|
||||
ret = i2c_smbus_read_i2c_block_data(data->client,
|
||||
LTR501_ALS_DATA1, sizeof(als_buf), (u8 *) als_buf);
|
||||
LTR501_ALS_DATA1,
|
||||
sizeof(als_buf),
|
||||
(u8 *)als_buf);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if (test_bit(0, indio_dev->active_scan_mask))
|
||||
|
@ -306,8 +311,7 @@ static irqreturn_t ltr501_trigger_handler(int irq, void *p)
|
|||
buf[j++] = ret & LTR501_PS_DATA_MASK;
|
||||
}
|
||||
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, buf,
|
||||
iio_get_time_ns());
|
||||
iio_push_to_buffers_with_timestamp(indio_dev, buf, iio_get_time_ns());
|
||||
|
||||
done:
|
||||
iio_trigger_notify_done(indio_dev->trig);
|
||||
|
|
Loading…
Reference in New Issue