Re: [PATCH 1/1] mfd: 88pm80x: Remove unnecessary exit APIs
Hi Samuel, Could you please check this patch which is pending since some time. On 7 December 2012 14:08, Sachin Kamat wrote: > This driver uses devm_* APIs. > Thus explicit exit calls (regmap_exit and devm_kfree) are not needed > as they are device managed APIs. > > Cc: Qiao Zhou > Signed-off-by: Sachin Kamat > --- > drivers/mfd/88pm80x.c | 19 +++ > 1 files changed, 3 insertions(+), 16 deletions(-) > > diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c > index 1adb355..3288a4a 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(>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(>dev, chip); > - return ret; > } > EXPORT_SYMBOL_GPL(pm80x_init); > > int pm80x_deinit(struct i2c_client *client) > { > - 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. > @@ -104,9 +94,6 @@ int pm80x_deinit(struct i2c_client *client) > else > g_pm80x_chip = NULL; > > - regmap_exit(chip->regmap); > - devm_kfree(>dev, chip); > - > return 0; > } > EXPORT_SYMBOL_GPL(pm80x_deinit); > -- > 1.7.4.1 > -- With warm regards, Sachin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1] mfd: 88pm80x: Remove unnecessary exit APIs
Hi Samuel, Could you please check this patch which is pending since some time. On 7 December 2012 14:08, Sachin Kamat sachin.ka...@linaro.org wrote: This driver uses devm_* APIs. Thus explicit exit calls (regmap_exit and devm_kfree) are not needed as they are device managed APIs. Cc: Qiao Zhou zhouq...@marvell.com Signed-off-by: Sachin Kamat sachin.ka...@linaro.org --- drivers/mfd/88pm80x.c | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c index 1adb355..3288a4a 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) { - 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. @@ -104,9 +94,6 @@ int pm80x_deinit(struct i2c_client *client) else g_pm80x_chip = NULL; - regmap_exit(chip-regmap); - devm_kfree(client-dev, chip); - return 0; } EXPORT_SYMBOL_GPL(pm80x_deinit); -- 1.7.4.1 -- With warm regards, Sachin -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/1] mfd: 88pm80x: Remove unnecessary exit APIs
This driver uses devm_* APIs. Thus explicit exit calls (regmap_exit and devm_kfree) are not needed as they are device managed APIs. Cc: Qiao Zhou Signed-off-by: Sachin Kamat --- drivers/mfd/88pm80x.c | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c index 1adb355..3288a4a 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(>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(>dev, chip); - return ret; } EXPORT_SYMBOL_GPL(pm80x_init); int pm80x_deinit(struct i2c_client *client) { - 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. @@ -104,9 +94,6 @@ int pm80x_deinit(struct i2c_client *client) else g_pm80x_chip = NULL; - regmap_exit(chip->regmap); - devm_kfree(>dev, chip); - return 0; } EXPORT_SYMBOL_GPL(pm80x_deinit); -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/1] mfd: 88pm80x: Remove unnecessary exit APIs
This driver uses devm_* APIs. Thus explicit exit calls (regmap_exit and devm_kfree) are not needed as they are device managed APIs. Cc: Qiao Zhou zhouq...@marvell.com Signed-off-by: Sachin Kamat sachin.ka...@linaro.org --- drivers/mfd/88pm80x.c | 19 +++ 1 files changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c index 1adb355..3288a4a 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) { - 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. @@ -104,9 +94,6 @@ int pm80x_deinit(struct i2c_client *client) else g_pm80x_chip = NULL; - regmap_exit(chip-regmap); - devm_kfree(client-dev, chip); - return 0; } EXPORT_SYMBOL_GPL(pm80x_deinit); -- 1.7.4.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/