summaryrefslogtreecommitdiff
path: root/drivers/mfd/88pm80x.c
diff options
context:
space:
mode:
authorYi Zhang <yizhang@marvell.com>2013-01-22 06:43:45 +0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-02-14 03:22:54 +0400
commit306df798507d8e009a7d4a5e8ce238a3b107de20 (patch)
tree763002544391b3f0369dfb46dc4e4993a467e7c6 /drivers/mfd/88pm80x.c
parentb3aac62bbb1c3f8e71c88e6e477836def3058fe8 (diff)
downloadlinux-306df798507d8e009a7d4a5e8ce238a3b107de20.tar.xz
mfd: 88pm80x: Remove redundant devm_* calls
devm_* functions are device managed and make error handling and code simpler; it also fix error exit paths Signed-off-by: Yi Zhang <yizhang@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/88pm80x.c')
-rw-r--r--drivers/mfd/88pm80x.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c
index 1adb355d86d1..f736a46eb8c0 100644
--- a/drivers/mfd/88pm80x.c
+++ b/drivers/mfd/88pm80x.c
@@ -48,14 +48,12 @@ int pm80x_init(struct i2c_client *client,
ret = PTR_ERR(map);
dev_err(&client->dev, "Failed to allocate register map: %d\n",
ret);
- goto err_regmap_init;
+ return ret;
}
chip->id = id->driver_data;
- if (chip->id < CHIP_PM800 || chip->id > CHIP_PM805) {
- ret = -EINVAL;
- goto err_chip_id;
- }
+ if (chip->id < CHIP_PM800 || chip->id > CHIP_PM805)
+ return -EINVAL;
chip->client = client;
chip->regmap = map;
@@ -82,19 +80,11 @@ int pm80x_init(struct i2c_client *client,
}
return 0;
-
-err_chip_id:
- regmap_exit(map);
-err_regmap_init:
- devm_kfree(&client->dev, chip);
- return ret;
}
EXPORT_SYMBOL_GPL(pm80x_init);
-int pm80x_deinit(struct i2c_client *client)
+int pm80x_deinit(void)
{
- struct pm80x_chip *chip = i2c_get_clientdata(client);
-
/*
* workaround: clear the dependency between pm800 and pm805.
* would remove it after HW chip fixes the issue.
@@ -103,10 +93,6 @@ int pm80x_deinit(struct i2c_client *client)
g_pm80x_chip->companion = NULL;
else
g_pm80x_chip = NULL;
-
- regmap_exit(chip->regmap);
- devm_kfree(&client->dev, chip);
-
return 0;
}
EXPORT_SYMBOL_GPL(pm80x_deinit);