Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: adc: mcp3911: fix indentation

The whole file does not make use of indentation properly.
Do something about it.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20230822192259.1125792-5-marcus.folkesson@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Marcus Folkesson and committed by
Jonathan Cameron
7e504733 d1f6a2ac

+20 -21
+20 -21
drivers/iio/adc/mcp3911.c
··· 33 33 #define MCP3911_GAIN_VAL(ch, val) ((val << 3 * ch) & MCP3911_GAIN_MASK(ch)) 34 34 35 35 #define MCP3911_REG_STATUSCOM 0x0a 36 - #define MCP3911_STATUSCOM_DRHIZ BIT(12) 36 + #define MCP3911_STATUSCOM_DRHIZ BIT(12) 37 37 #define MCP3911_STATUSCOM_READ GENMASK(7, 6) 38 38 #define MCP3911_STATUSCOM_CH1_24WIDTH BIT(4) 39 39 #define MCP3911_STATUSCOM_CH0_24WIDTH BIT(3) ··· 111 111 return spi_write(adc->spi, &val, len + 1); 112 112 } 113 113 114 - static int mcp3911_update(struct mcp3911 *adc, u8 reg, u32 mask, 115 - u32 val, u8 len) 114 + static int mcp3911_update(struct mcp3911 *adc, u8 reg, u32 mask, u32 val, u8 len) 116 115 { 117 116 u32 tmp; 118 117 int ret; ··· 126 127 } 127 128 128 129 static int mcp3911_write_raw_get_fmt(struct iio_dev *indio_dev, 129 - struct iio_chan_spec const *chan, 130 - long mask) 130 + struct iio_chan_spec const *chan, 131 + long mask) 131 132 { 132 133 switch (mask) { 133 134 case IIO_CHAN_INFO_SCALE: ··· 140 141 } 141 142 142 143 static int mcp3911_read_avail(struct iio_dev *indio_dev, 143 - struct iio_chan_spec const *chan, 144 - const int **vals, int *type, int *length, 145 - long info) 144 + struct iio_chan_spec const *chan, 145 + const int **vals, int *type, int *length, 146 + long info) 146 147 { 147 148 switch (info) { 148 149 case IIO_CHAN_INFO_OVERSAMPLING_RATIO: ··· 211 212 } 212 213 213 214 static int mcp3911_write_raw(struct iio_dev *indio_dev, 214 - struct iio_chan_spec const *channel, int val, 215 - int val2, long mask) 215 + struct iio_chan_spec const *channel, int val, 216 + int val2, long mask) 216 217 { 217 218 struct mcp3911 *adc = iio_priv(indio_dev); 218 219 int ret = -EINVAL; ··· 222 223 case IIO_CHAN_INFO_SCALE: 223 224 for (int i = 0; i < MCP3911_NUM_SCALES; i++) { 224 225 if (val == mcp3911_scale_table[i][0] && 225 - val2 == mcp3911_scale_table[i][1]) { 226 + val2 == mcp3911_scale_table[i][1]) { 226 227 227 228 adc->gain[channel->channel] = BIT(i); 228 229 ret = mcp3911_update(adc, MCP3911_REG_GAIN, 229 - MCP3911_GAIN_MASK(channel->channel), 230 - MCP3911_GAIN_VAL(channel->channel, i), 1); 230 + MCP3911_GAIN_MASK(channel->channel), 231 + MCP3911_GAIN_VAL(channel->channel, i), 1); 231 232 } 232 233 } 233 234 break; ··· 245 246 246 247 /* Enable offset*/ 247 248 ret = mcp3911_update(adc, MCP3911_REG_STATUSCOM, 248 - MCP3911_STATUSCOM_EN_OFFCAL, 249 - MCP3911_STATUSCOM_EN_OFFCAL, 2); 249 + MCP3911_STATUSCOM_EN_OFFCAL, 250 + MCP3911_STATUSCOM_EN_OFFCAL, 2); 250 251 break; 251 252 252 253 case IIO_CHAN_INFO_OVERSAMPLING_RATIO: ··· 254 255 if (val == mcp3911_osr_table[i]) { 255 256 val = FIELD_PREP(MCP3911_CONFIG_OSR, i); 256 257 ret = mcp3911_update(adc, MCP3911_REG_CONFIG, MCP3911_CONFIG_OSR, 257 - val, 2); 258 + val, 2); 258 259 break; 259 260 } 260 261 } ··· 505 506 506 507 if (device_property_read_bool(dev, "microchip,data-ready-hiz")) 507 508 ret = mcp3911_update(adc, MCP3911_REG_STATUSCOM, MCP3911_STATUSCOM_DRHIZ, 508 - 0, 2); 509 + 0, 2); 509 510 else 510 511 ret = mcp3911_update(adc, MCP3911_REG_STATUSCOM, MCP3911_STATUSCOM_DRHIZ, 511 - MCP3911_STATUSCOM_DRHIZ, 2); 512 + MCP3911_STATUSCOM_DRHIZ, 2); 512 513 if (ret) 513 514 return ret; 514 515 ··· 516 517 if (ret) 517 518 return ret; 518 519 519 - /* Set gain to 1 for all channels */ 520 + /* Set gain to 1 for all channels */ 520 521 for (int i = 0; i < MCP3911_NUM_CHANNELS; i++) { 521 522 adc->gain[i] = 1; 522 523 ret = mcp3911_update(adc, MCP3911_REG_GAIN, 523 - MCP3911_GAIN_MASK(i), 524 - MCP3911_GAIN_VAL(i, 0), 1); 524 + MCP3911_GAIN_MASK(i), 525 + MCP3911_GAIN_VAL(i, 0), 1); 525 526 if (ret) 526 527 return ret; 527 528 }