staging: iio: tsl2x7x: add common function for reading chip status
There were three places where the same chunk of code was used to read the chip status. This patch creates a common function tsl2x7x_read_status() to reduce duplicate code. This patch also corrects tsl2x7x_event_handler() to properly check for an error after reading the chip status. Signed-off-by: NBrian Masney <masneyb@onstation.org> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Showing
想要评论请 注册 或 登录