Commit ab158628 authored by Lothar Rubusch's avatar Lothar Rubusch Committed by Jonathan Cameron

iio: accel: adxl345: Group bus configuration

Group the indio_dev initialization and bus configuration for improved
readability.
Signed-off-by: default avatarLothar Rubusch <l.rubusch@gmail.com>
Link: https://lore.kernel.org/r/20240401194906.56810-3-l.rubusch@gmail.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent f68ebfe1
......@@ -229,18 +229,18 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap)
if (!data->info)
return -ENODEV;
/* Enable full-resolution mode */
ret = regmap_update_bits(regmap, ADXL345_REG_DATA_FORMAT,
data_format_mask, ADXL345_DATA_FORMAT_FULL_RES);
if (ret)
return dev_err_probe(dev, ret, "Failed to set data range\n");
indio_dev->name = data->info->name;
indio_dev->info = &adxl345_info;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = adxl345_channels;
indio_dev->num_channels = ARRAY_SIZE(adxl345_channels);
/* Enable full-resolution mode */
ret = regmap_update_bits(regmap, ADXL345_REG_DATA_FORMAT,
data_format_mask, ADXL345_DATA_FORMAT_FULL_RES);
if (ret)
return dev_err_probe(dev, ret, "Failed to set data range\n");
/* Enable measurement mode */
ret = adxl345_powerup(data->regmap);
if (ret < 0)
......
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