Commit ce0d3761 authored by Sai Krishna Potthuri's avatar Sai Krishna Potthuri Committed by Jonathan Cameron

iio: adc: xadc: Fix coding style violations

This patch fix following checkpatch warnings in xadc driver
1. prefer 'unsigned int' to bare use of 'unsigned'.
2. else is not generally useful after a break or return.
3. fill all function definition arguments with identifier name
Signed-off-by: default avatarSai Krishna Potthuri <lakshmis@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent b24d1097
...@@ -68,7 +68,7 @@ void xadc_handle_events(struct iio_dev *indio_dev, unsigned long events) ...@@ -68,7 +68,7 @@ void xadc_handle_events(struct iio_dev *indio_dev, unsigned long events)
xadc_handle_event(indio_dev, i); xadc_handle_event(indio_dev, i);
} }
static unsigned xadc_get_threshold_offset(const struct iio_chan_spec *chan, static unsigned int xadc_get_threshold_offset(const struct iio_chan_spec *chan,
enum iio_event_direction dir) enum iio_event_direction dir)
{ {
unsigned int offset; unsigned int offset;
...@@ -90,9 +90,8 @@ static unsigned xadc_get_threshold_offset(const struct iio_chan_spec *chan, ...@@ -90,9 +90,8 @@ static unsigned xadc_get_threshold_offset(const struct iio_chan_spec *chan,
static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan) static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan)
{ {
if (chan->type == IIO_TEMP) { if (chan->type == IIO_TEMP)
return XADC_ALARM_OT_MASK; return XADC_ALARM_OT_MASK;
} else {
switch (chan->channel) { switch (chan->channel) {
case 0: case 0:
return XADC_ALARM_VCCINT_MASK; return XADC_ALARM_VCCINT_MASK;
...@@ -110,7 +109,6 @@ static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan) ...@@ -110,7 +109,6 @@ static unsigned int xadc_get_alarm_mask(const struct iio_chan_spec *chan)
/* We will never get here */ /* We will never get here */
return 0; return 0;
} }
}
} }
int xadc_read_event_config(struct iio_dev *indio_dev, int xadc_read_event_config(struct iio_dev *indio_dev,
......
...@@ -71,13 +71,13 @@ struct xadc { ...@@ -71,13 +71,13 @@ struct xadc {
}; };
struct xadc_ops { struct xadc_ops {
int (*read)(struct xadc *, unsigned int, uint16_t *); int (*read)(struct xadc *xadc, unsigned int reg, uint16_t *val);
int (*write)(struct xadc *, unsigned int, uint16_t); int (*write)(struct xadc *xadc, unsigned int reg, uint16_t val);
int (*setup)(struct platform_device *pdev, struct iio_dev *indio_dev, int (*setup)(struct platform_device *pdev, struct iio_dev *indio_dev,
int irq); int irq);
void (*update_alarm)(struct xadc *, unsigned int); void (*update_alarm)(struct xadc *xadc, unsigned int alarm);
unsigned long (*get_dclk_rate)(struct xadc *); unsigned long (*get_dclk_rate)(struct xadc *xadc);
irqreturn_t (*interrupt_handler)(int, void *); irqreturn_t (*interrupt_handler)(int irq, void *devid);
unsigned int flags; unsigned int flags;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment