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: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe()

Move sca3000_stop_all_interrupts() above sca3000_probe() without
altering its logic so the next set of patches are easier to review.

No functional change.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Harshit Mogalapalli and committed by
Jonathan Cameron
aa598c22 4390d416

+18 -18
+18 -18
drivers/iio/accel/sca3000.c
··· 1427 1427 .write_event_config = &sca3000_write_event_config, 1428 1428 }; 1429 1429 1430 + static int sca3000_stop_all_interrupts(struct sca3000_state *st) 1431 + { 1432 + int ret; 1433 + 1434 + mutex_lock(&st->lock); 1435 + ret = sca3000_read_data_short(st, SCA3000_REG_INT_MASK_ADDR, 1); 1436 + if (ret) 1437 + goto error_ret; 1438 + ret = sca3000_write_reg(st, SCA3000_REG_INT_MASK_ADDR, 1439 + (st->rx[0] & 1440 + ~(SCA3000_REG_INT_MASK_RING_THREE_QUARTER | 1441 + SCA3000_REG_INT_MASK_RING_HALF | 1442 + SCA3000_REG_INT_MASK_ALL_INTS))); 1443 + error_ret: 1444 + mutex_unlock(&st->lock); 1445 + return ret; 1446 + } 1447 + 1430 1448 static int sca3000_probe(struct spi_device *spi) 1431 1449 { 1432 1450 struct device *dev = &spi->dev; ··· 1500 1482 return ret; 1501 1483 1502 1484 return 0; 1503 - } 1504 - 1505 - static int sca3000_stop_all_interrupts(struct sca3000_state *st) 1506 - { 1507 - int ret; 1508 - 1509 - mutex_lock(&st->lock); 1510 - ret = sca3000_read_data_short(st, SCA3000_REG_INT_MASK_ADDR, 1); 1511 - if (ret) 1512 - goto error_ret; 1513 - ret = sca3000_write_reg(st, SCA3000_REG_INT_MASK_ADDR, 1514 - (st->rx[0] & 1515 - ~(SCA3000_REG_INT_MASK_RING_THREE_QUARTER | 1516 - SCA3000_REG_INT_MASK_RING_HALF | 1517 - SCA3000_REG_INT_MASK_ALL_INTS))); 1518 - error_ret: 1519 - mutex_unlock(&st->lock); 1520 - return ret; 1521 1485 } 1522 1486 1523 1487 static void sca3000_remove(struct spi_device *spi)