summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSangbeom Kim <sbkim73@samsung.com>2012-01-20 08:09:11 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2012-03-06 18:46:36 +0100
commit621210e25d5de02dae111ad90548577dd64c7663 (patch)
tree300ea5085d61d2b0f6e2a0bfe39c90e3c6d5e835 /drivers
parentmfd: Initialize tps65910 irq platform data properly (diff)
downloadlinux-621210e25d5de02dae111ad90548577dd64c7663.tar.xz
linux-621210e25d5de02dae111ad90548577dd64c7663.zip
mfd: Convert s5m core driver to use devm_kzalloc()
Convert s5m core driver to use devm_kzalloc(). Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/s5m-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mfd/s5m-core.c b/drivers/mfd/s5m-core.c
index caadabeed8e9..75853988fe3e 100644
--- a/drivers/mfd/s5m-core.c
+++ b/drivers/mfd/s5m-core.c
@@ -77,7 +77,8 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
int ret = 0;
int error;
- s5m87xx = kzalloc(sizeof(struct s5m87xx_dev), GFP_KERNEL);
+ s5m87xx = devm_kzalloc(&i2c->dev, sizeof(struct s5m87xx_dev),
+ GFP_KERNEL);
if (s5m87xx == NULL)
return -ENOMEM;
@@ -126,7 +127,6 @@ err:
s5m_irq_exit(s5m87xx);
i2c_unregister_device(s5m87xx->rtc);
regmap_exit(s5m87xx->regmap);
- kfree(s5m87xx);
return ret;
}
@@ -138,7 +138,6 @@ static int s5m87xx_i2c_remove(struct i2c_client *i2c)
s5m_irq_exit(s5m87xx);
i2c_unregister_device(s5m87xx->rtc);
regmap_exit(s5m87xx->regmap);
- kfree(s5m87xx);
return 0;
}