Fixes the following error:
drivers/thermal/exynos_thermal.c:393:4: error: too few arguments to function
‘thermal_zone_device_register’
Added the missing 'mask' argument.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/thermal/exynos_thermal.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index 07736ea..f6debad 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -389,7 +389,7 @@ static int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf)
th_zone->cool_dev_size = count;
th_zone->therm_dev = thermal_zone_device_register(sensor_conf->name,
- EXYNOS_ZONE_COUNT, NULL, &exynos_dev_ops, 0, 0, 0,
+ EXYNOS_ZONE_COUNT, 0, NULL, &exynos_dev_ops, 0, 0, 0,
IDLE_INTERVAL);
if (IS_ERR(th_zone->therm_dev)) {
--
1.7.4.1
err.h header file was included twice.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/thermal/exynos_thermal.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index f6debad..3a7a068 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -33,7 +33,6 @@
#include <linux/kobject.h>
#include <linux/io.h>
#include <linux/mutex.h>
-#include <linux/err.h>
#include <linux/platform_data/exynos_thermal.h>
#include <linux/thermal.h>
#include <linux/cpufreq.h>
--
1.7.4.1
devm_* functions are used to replace kzalloc, request_mem_region, ioremap
and request_irq functions in probe call. With the usage of devm_* functions
explicit freeing and unmapping is not required.
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Sachin Kamat <[email protected]>
---
drivers/thermal/exynos_thermal.c | 51 +++++++------------------------------
1 files changed, 10 insertions(+), 41 deletions(-)
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
index 3a7a068..86e4e9f 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -780,7 +780,9 @@ static int __devinit exynos_tmu_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "No platform init data supplied.\n");
return -ENODEV;
}
- data = kzalloc(sizeof(struct exynos_tmu_data), GFP_KERNEL);
+
+ data = devm_kzalloc(&pdev->dev, sizeof(struct exynos_tmu_data),
+ GFP_KERNEL);
if (!data) {
dev_err(&pdev->dev, "Failed to allocate driver structure\n");
return -ENOMEM;
@@ -788,47 +790,29 @@ static int __devinit exynos_tmu_probe(struct platform_device *pdev)
data->irq = platform_get_irq(pdev, 0);
if (data->irq < 0) {
- ret = data->irq;
dev_err(&pdev->dev, "Failed to get platform irq\n");
- goto err_free;
+ return data->irq;
}
INIT_WORK(&data->irq_work, exynos_tmu_work);
data->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!data->mem) {
- ret = -ENOENT;
- dev_err(&pdev->dev, "Failed to get platform resource\n");
- goto err_free;
- }
- data->mem = request_mem_region(data->mem->start,
- resource_size(data->mem), pdev->name);
- if (!data->mem) {
- ret = -ENODEV;
- dev_err(&pdev->dev, "Failed to request memory region\n");
- goto err_free;
- }
-
- data->base = ioremap(data->mem->start, resource_size(data->mem));
- if (!data->base) {
- ret = -ENODEV;
- dev_err(&pdev->dev, "Failed to ioremap memory\n");
- goto err_mem_region;
- }
+ data->base = devm_request_and_ioremap(&pdev->dev, data->mem);
+ if (!data->base)
+ return -ENODEV;
- ret = request_irq(data->irq, exynos_tmu_irq,
+ ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq,
IRQF_TRIGGER_RISING, "exynos-tmu", data);
if (ret) {
dev_err(&pdev->dev, "Failed to request irq: %d\n", data->irq);
- goto err_io_remap;
+ return ret;
}
data->clk = clk_get(NULL, "tmu_apbif");
if (IS_ERR(data->clk)) {
- ret = PTR_ERR(data->clk);
dev_err(&pdev->dev, "Failed to get clock\n");
- goto err_irq;
+ return PTR_ERR(data->clk);
}
if (pdata->type == SOC_ARCH_EXYNOS5 ||
@@ -880,14 +864,6 @@ static int __devinit exynos_tmu_probe(struct platform_device *pdev)
err_clk:
platform_set_drvdata(pdev, NULL);
clk_put(data->clk);
-err_irq:
- free_irq(data->irq, data);
-err_io_remap:
- iounmap(data->base);
-err_mem_region:
- release_mem_region(data->mem->start, resource_size(data->mem));
-err_free:
- kfree(data);
return ret;
}
@@ -902,15 +878,8 @@ static int __devexit exynos_tmu_remove(struct platform_device *pdev)
clk_put(data->clk);
- free_irq(data->irq, data);
-
- iounmap(data->base);
- release_mem_region(data->mem->start, resource_size(data->mem));
-
platform_set_drvdata(pdev, NULL);
- kfree(data);
-
return 0;
}
--
1.7.4.1