iio: pressure: bmp280: Rearrange vars in reverse xmas tree order
authorAngel Iglesias <ang.iglesiasg@gmail.com>
Sun, 22 Oct 2023 17:22:19 +0000 (19:22 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 16 Nov 2023 19:10:27 +0000 (19:10 +0000)
Small cleanup reordering local variable declarations following reverse
christmas tree convention.

Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/bb63a996eb9c4555bf83471770f0169d2627e79c.1697994521.git.ang.iglesiasg@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/bmp280-i2c.c
drivers/iio/pressure/bmp280-spi.c

index b3e069730f97214e7a5da3894cc4ef68b96d9f6a..34e3bc758493ea605facae8bf28546bfa904a0b4 100644 (file)
@@ -7,9 +7,9 @@
 
 static int bmp280_i2c_probe(struct i2c_client *client)
 {
-       struct regmap *regmap;
-       const struct bmp280_chip_info *chip_info;
        const struct i2c_device_id *id = i2c_client_get_device_id(client);
+       const struct bmp280_chip_info *chip_info;
+       struct regmap *regmap;
 
        chip_info = i2c_get_match_data(client);
 
index 2eed483a8cc4c94636037918f24a963ce8e450ab..433d6fac83c4cd95f698e1063a78c36dde79b374 100644 (file)
@@ -14,8 +14,7 @@
 static int bmp280_regmap_spi_write(void *context, const void *data,
                                    size_t count)
 {
-       struct device *dev = context;
-       struct spi_device *spi = to_spi_device(dev);
+       struct spi_device *spi = to_spi_device(context);
        u8 buf[2];
 
        memcpy(buf, data, 2);
@@ -31,8 +30,7 @@ static int bmp280_regmap_spi_write(void *context, const void *data,
 static int bmp280_regmap_spi_read(void *context, const void *reg,
                                   size_t reg_size, void *val, size_t val_size)
 {
-       struct device *dev = context;
-       struct spi_device *spi = to_spi_device(dev);
+       struct spi_device *spi = to_spi_device(context);
 
        return spi_write_then_read(spi, reg, reg_size, val, val_size);
 }