mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
iio: light: opt3001: ensure correct parenthesis alignment
Ensure correct parenthesis alignment per checkpatch.pl report. No functional change. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
8289400299
commit
9b77844951
|
|
@ -223,8 +223,8 @@ static const struct opt3001_scale opt3002_scales[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static int opt3001_find_scale(const struct opt3001 *opt, int val,
|
||||
int val2, u8 *exponent)
|
||||
static int opt3001_find_scale(const struct opt3001 *opt, int val, int val2,
|
||||
u8 *exponent)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ARRAY_SIZE(*opt->chip_info->scales); i++) {
|
||||
|
|
@ -242,8 +242,8 @@ static int opt3001_find_scale(const struct opt3001 *opt, int val,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static void opt3001_to_iio_ret(struct opt3001 *opt, u8 exponent,
|
||||
u16 mantissa, int *val, int *val2)
|
||||
static void opt3001_to_iio_ret(struct opt3001 *opt, u8 exponent, u16 mantissa,
|
||||
int *val, int *val2)
|
||||
{
|
||||
int ret;
|
||||
int whole = opt->chip_info->factor_whole;
|
||||
|
|
@ -364,8 +364,8 @@ static int opt3001_get_processed(struct opt3001 *opt, int *val, int *val2)
|
|||
if (opt->use_irq) {
|
||||
/* Wait for the IRQ to indicate the conversion is complete */
|
||||
ret = wait_event_timeout(opt->result_ready_queue,
|
||||
opt->result_ready,
|
||||
msecs_to_jiffies(OPT3001_RESULT_READY_LONG));
|
||||
opt->result_ready,
|
||||
msecs_to_jiffies(OPT3001_RESULT_READY_LONG));
|
||||
if (ret == 0) {
|
||||
ret = -ETIMEDOUT;
|
||||
goto err;
|
||||
|
|
@ -476,8 +476,8 @@ static int opt3001_set_int_time(struct opt3001 *opt, int time)
|
|||
}
|
||||
|
||||
static int opt3001_read_raw(struct iio_dev *iio,
|
||||
struct iio_chan_spec const *chan, int *val, int *val2,
|
||||
long mask)
|
||||
struct iio_chan_spec const *chan,
|
||||
int *val, int *val2, long mask)
|
||||
{
|
||||
struct opt3001 *opt = iio_priv(iio);
|
||||
int ret;
|
||||
|
|
@ -508,8 +508,8 @@ static int opt3001_read_raw(struct iio_dev *iio,
|
|||
}
|
||||
|
||||
static int opt3001_write_raw(struct iio_dev *iio,
|
||||
struct iio_chan_spec const *chan, int val, int val2,
|
||||
long mask)
|
||||
struct iio_chan_spec const *chan,
|
||||
int val, int val2, long mask)
|
||||
{
|
||||
struct opt3001 *opt = iio_priv(iio);
|
||||
int ret;
|
||||
|
|
@ -534,9 +534,11 @@ static int opt3001_write_raw(struct iio_dev *iio,
|
|||
}
|
||||
|
||||
static int opt3001_read_event_value(struct iio_dev *iio,
|
||||
const struct iio_chan_spec *chan, enum iio_event_type type,
|
||||
enum iio_event_direction dir, enum iio_event_info info,
|
||||
int *val, int *val2)
|
||||
const struct iio_chan_spec *chan,
|
||||
enum iio_event_type type,
|
||||
enum iio_event_direction dir,
|
||||
enum iio_event_info info,
|
||||
int *val, int *val2)
|
||||
{
|
||||
struct opt3001 *opt = iio_priv(iio);
|
||||
int ret = IIO_VAL_INT_PLUS_MICRO;
|
||||
|
|
@ -546,11 +548,11 @@ static int opt3001_read_event_value(struct iio_dev *iio,
|
|||
switch (dir) {
|
||||
case IIO_EV_DIR_RISING:
|
||||
opt3001_to_iio_ret(opt, opt->high_thresh_exp,
|
||||
opt->high_thresh_mantissa, val, val2);
|
||||
opt->high_thresh_mantissa, val, val2);
|
||||
break;
|
||||
case IIO_EV_DIR_FALLING:
|
||||
opt3001_to_iio_ret(opt, opt->low_thresh_exp,
|
||||
opt->low_thresh_mantissa, val, val2);
|
||||
opt->low_thresh_mantissa, val, val2);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
|
|
@ -562,9 +564,11 @@ static int opt3001_read_event_value(struct iio_dev *iio,
|
|||
}
|
||||
|
||||
static int opt3001_write_event_value(struct iio_dev *iio,
|
||||
const struct iio_chan_spec *chan, enum iio_event_type type,
|
||||
enum iio_event_direction dir, enum iio_event_info info,
|
||||
int val, int val2)
|
||||
const struct iio_chan_spec *chan,
|
||||
enum iio_event_type type,
|
||||
enum iio_event_direction dir,
|
||||
enum iio_event_info info,
|
||||
int val, int val2)
|
||||
{
|
||||
struct opt3001 *opt = iio_priv(iio);
|
||||
struct i2c_client *client = opt->client;
|
||||
|
|
@ -628,8 +632,9 @@ static int opt3001_write_event_value(struct iio_dev *iio,
|
|||
}
|
||||
|
||||
static int opt3001_read_event_config(struct iio_dev *iio,
|
||||
const struct iio_chan_spec *chan, enum iio_event_type type,
|
||||
enum iio_event_direction dir)
|
||||
const struct iio_chan_spec *chan,
|
||||
enum iio_event_type type,
|
||||
enum iio_event_direction dir)
|
||||
{
|
||||
struct opt3001 *opt = iio_priv(iio);
|
||||
|
||||
|
|
@ -637,8 +642,10 @@ static int opt3001_read_event_config(struct iio_dev *iio,
|
|||
}
|
||||
|
||||
static int opt3001_write_event_config(struct iio_dev *iio,
|
||||
const struct iio_chan_spec *chan, enum iio_event_type type,
|
||||
enum iio_event_direction dir, bool state)
|
||||
const struct iio_chan_spec *chan,
|
||||
enum iio_event_type type,
|
||||
enum iio_event_direction dir,
|
||||
bool state)
|
||||
{
|
||||
struct opt3001 *opt = iio_priv(iio);
|
||||
struct i2c_client *client = opt->client;
|
||||
|
|
@ -802,16 +809,16 @@ static irqreturn_t opt3001_irq(int irq, void *_iio)
|
|||
OPT3001_CONFIGURATION_M_CONTINUOUS) {
|
||||
if (ret & OPT3001_CONFIGURATION_FH)
|
||||
iio_push_event(iio,
|
||||
IIO_UNMOD_EVENT_CODE(chan_type, 0,
|
||||
IIO_EV_TYPE_THRESH,
|
||||
IIO_EV_DIR_RISING),
|
||||
iio_get_time_ns(iio));
|
||||
IIO_UNMOD_EVENT_CODE(chan_type, 0,
|
||||
IIO_EV_TYPE_THRESH,
|
||||
IIO_EV_DIR_RISING),
|
||||
iio_get_time_ns(iio));
|
||||
if (ret & OPT3001_CONFIGURATION_FL)
|
||||
iio_push_event(iio,
|
||||
IIO_UNMOD_EVENT_CODE(chan_type, 0,
|
||||
IIO_EV_TYPE_THRESH,
|
||||
IIO_EV_DIR_FALLING),
|
||||
iio_get_time_ns(iio));
|
||||
IIO_UNMOD_EVENT_CODE(chan_type, 0,
|
||||
IIO_EV_TYPE_THRESH,
|
||||
IIO_EV_DIR_FALLING),
|
||||
iio_get_time_ns(iio));
|
||||
} else if (ret & OPT3001_CONFIGURATION_CRF) {
|
||||
ret = i2c_smbus_read_word_swapped(client, OPT3001_RESULT);
|
||||
if (ret < 0) {
|
||||
|
|
@ -874,8 +881,8 @@ static int opt3001_probe(struct i2c_client *client)
|
|||
/* Make use of INT pin only if valid IRQ no. is given */
|
||||
if (irq > 0) {
|
||||
ret = request_threaded_irq(irq, NULL, opt3001_irq,
|
||||
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
|
||||
"opt3001", iio);
|
||||
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
|
||||
"opt3001", iio);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret,
|
||||
"failed to request IRQ #%d\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user