|
@@ -890,7 +890,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- i2c = kzalloc(sizeof(struct s3c24xx_i2c), GFP_KERNEL);
|
|
|
+ i2c = devm_kzalloc(&pdev->dev, sizeof(struct s3c24xx_i2c), GFP_KERNEL);
|
|
|
if (!i2c) {
|
|
|
dev_err(&pdev->dev, "no memory for state\n");
|
|
|
return -ENOMEM;
|
|
@@ -1035,7 +1035,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
|
|
|
clk_put(i2c->clk);
|
|
|
|
|
|
err_noclk:
|
|
|
- kfree(i2c);
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -1061,7 +1060,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
|
|
|
release_resource(i2c->ioarea);
|
|
|
s3c24xx_i2c_dt_gpio_free(i2c);
|
|
|
kfree(i2c->ioarea);
|
|
|
- kfree(i2c);
|
|
|
|
|
|
return 0;
|
|
|
}
|