Skip to content

Commit

Permalink
mfd: max77686: Fix regmap resource leak on driver remove
Browse files Browse the repository at this point in the history
The regmap used by max77686 MFD driver was not freed with regmap_exit()
on driver exit. This lead to leak of resources.

Replace regmap_init_i2c() call in driver probe with initialization of
managed register map so the regmap will be properly freed by the device
management code.

Cc: [email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
  • Loading branch information
krzk authored and Lee Jones committed Jan 21, 2014
1 parent f876a97 commit 74142ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/max77686.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
max77686->irq_gpio = pdata->irq_gpio;
max77686->irq = i2c->irq;

max77686->regmap = regmap_init_i2c(i2c, &max77686_regmap_config);
max77686->regmap = devm_regmap_init_i2c(i2c, &max77686_regmap_config);
if (IS_ERR(max77686->regmap)) {
ret = PTR_ERR(max77686->regmap);
dev_err(max77686->dev, "Failed to allocate register map: %d\n",
Expand Down

0 comments on commit 74142ff

Please sign in to comment.