OSDN Git Service

staging: iio: tsl2x7x: add common function for writing to the control register
authorBrian Masney <masneyb@onstation.org>
Sun, 4 Mar 2018 01:49:34 +0000 (20:49 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 10 Mar 2018 14:38:58 +0000 (14:38 +0000)
commitf5d9bca666078871f27eef6b18e507498840eb70
tree89dc9a6e20b45bf565c620aa4da36892a5cb6a89
parent107eb59bc15ccd999b8cd297172691673396ec8f
staging: iio: tsl2x7x: add common function for writing to the control register

There were four places where the same chunk of code was used to write
to the control register. This patch creates a common function
tsl2x7x_write_control_reg() to reduce duplicate code.

The function tsl2x7x_chip_off() did not correctly return an error
code so this patch also corrects that issue.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/light/tsl2x7x.c