aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/da9052-spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/da9052-spi.c')
-rw-r--r--drivers/mfd/da9052-spi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c
index 17666b40b70c..45ae0b7d13ef 100644
--- a/drivers/mfd/da9052-spi.c
+++ b/drivers/mfd/da9052-spi.c
@@ -23,6 +23,7 @@
23 23
24static int da9052_spi_probe(struct spi_device *spi) 24static int da9052_spi_probe(struct spi_device *spi)
25{ 25{
26 struct regmap_config config;
26 int ret; 27 int ret;
27 const struct spi_device_id *id = spi_get_device_id(spi); 28 const struct spi_device_id *id = spi_get_device_id(spi);
28 struct da9052 *da9052; 29 struct da9052 *da9052;
@@ -40,10 +41,10 @@ static int da9052_spi_probe(struct spi_device *spi)
40 41
41 spi_set_drvdata(spi, da9052); 42 spi_set_drvdata(spi, da9052);
42 43
43 da9052_regmap_config.read_flag_mask = 1; 44 config = da9052_regmap_config;
44 da9052_regmap_config.write_flag_mask = 0; 45 config.read_flag_mask = 1;
45 46
46 da9052->regmap = devm_regmap_init_spi(spi, &da9052_regmap_config); 47 da9052->regmap = devm_regmap_init_spi(spi, &config);
47 if (IS_ERR(da9052->regmap)) { 48 if (IS_ERR(da9052->regmap)) {
48 ret = PTR_ERR(da9052->regmap); 49 ret = PTR_ERR(da9052->regmap);
49 dev_err(&spi->dev, "Failed to allocate register map: %d\n", 50 dev_err(&spi->dev, "Failed to allocate register map: %d\n",