diff options
| author | Petre Rodan <petre.rodan@subdimension.ro> | 2025-10-05 16:12:20 +0300 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2025-10-19 11:59:19 +0100 |
| commit | 5c27f1332282522de8da839bbdd2d1b2f0a6c960 (patch) | |
| tree | 2b818e69dacd2b0492d28a95d3969a481a522483 /drivers/iio/accel/bma220_spi.c | |
| parent | 2027b1a201eafe1697b34a5d87c41127864eb4f9 (diff) | |
| download | lwn-5c27f1332282522de8da839bbdd2d1b2f0a6c960.tar.gz lwn-5c27f1332282522de8da839bbdd2d1b2f0a6c960.zip | |
iio: accel: bma220: migrate to regmap API
Switch to regmap API.
Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/bma220_spi.c')
| -rw-r--r-- | drivers/iio/accel/bma220_spi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index e1c25f48d9b3..7aced4017373 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -7,6 +7,7 @@ #include <linux/mod_devicetable.h> #include <linux/module.h> +#include <linux/regmap.h> #include <linux/types.h> #include <linux/spi/spi.h> @@ -14,7 +15,14 @@ static int bma220_spi_probe(struct spi_device *spi) { - return bma220_common_probe(spi); + struct regmap *regmap; + + regmap = devm_regmap_init_spi(spi, &bma220_spi_regmap_config); + if (IS_ERR(regmap)) + return dev_err_probe(&spi->dev, PTR_ERR(regmap), + "failed to create regmap\n"); + + return bma220_common_probe(&spi->dev, regmap, spi->irq); } static const struct spi_device_id bma220_spi_id[] = { |
