diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-21 08:28:46 -0500 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-03-07 13:06:53 -0500 |
commit | 4ea1557ff7862f63511420395d16647b74ba6f5c (patch) | |
tree | 319420a8e7d679af274d2abb8b9494d286b80701 /drivers/i2c | |
parent | 979b907fa55be8cdbbf455b9204b7e4602f303e6 (diff) |
i2c-s3c2410: Convert to devm_kzalloc()
Saves remembering to call kfree(). There's some kfree()s used by the
resource still, these will be removed in 3.3 using the newly added
devm_request_and_ioremap().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 4c1718081685..e6f982be89a8 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -890,7 +890,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
890 | } | 890 | } |
891 | } | 891 | } |
892 | 892 | ||
893 | i2c = kzalloc(sizeof(struct s3c24xx_i2c), GFP_KERNEL); | 893 | i2c = devm_kzalloc(&pdev->dev, sizeof(struct s3c24xx_i2c), GFP_KERNEL); |
894 | if (!i2c) { | 894 | if (!i2c) { |
895 | dev_err(&pdev->dev, "no memory for state\n"); | 895 | dev_err(&pdev->dev, "no memory for state\n"); |
896 | return -ENOMEM; | 896 | return -ENOMEM; |
@@ -1035,7 +1035,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
1035 | clk_put(i2c->clk); | 1035 | clk_put(i2c->clk); |
1036 | 1036 | ||
1037 | err_noclk: | 1037 | err_noclk: |
1038 | kfree(i2c); | ||
1039 | return ret; | 1038 | return ret; |
1040 | } | 1039 | } |
1041 | 1040 | ||
@@ -1061,7 +1060,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) | |||
1061 | release_resource(i2c->ioarea); | 1060 | release_resource(i2c->ioarea); |
1062 | s3c24xx_i2c_dt_gpio_free(i2c); | 1061 | s3c24xx_i2c_dt_gpio_free(i2c); |
1063 | kfree(i2c->ioarea); | 1062 | kfree(i2c->ioarea); |
1064 | kfree(i2c); | ||
1065 | 1063 | ||
1066 | return 0; | 1064 | return 0; |
1067 | } | 1065 | } |