diff options
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 | } |