Skip to contentSkip to conversation

ARM: EXYNOS: Use dev_err() instead of printk() for cpuidle driver

PATCH New Jingoo Han 2 participants 3 messages Oct 21, 2013 – Oct 30, 2013

Subsystems (3)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/2 ARM: EXYNOS: Use dev_err() instead of printk() for cpuidle driver

Change raw printk() call to dev_err() to provide a better message to userspace so it can properly identify the device.

---
- Based against pm-cpuidle branch
- Tested on Exynos5440

 arch/arm/mach-exynos/cpuidle.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/cpuidle.c +2 -2
index 1bde6ad..6616e0f 100644
@@ -206,7 +206,7 @@ static int __init exynos_cpuidle_probe(struct platform_device *pdev)
 
 	ret = cpuidle_register_driver(&exynos4_idle_driver);
 	if (ret) {
-		printk(KERN_ERR "CPUidle failed to register driver\n");
+		dev_err(&pdev->dev, "failed to register cpuidle driver\n");
 		return ret;
 	}
 
@@ -220,7 +220,7 @@ static int __init exynos_cpuidle_probe(struct platform_device *pdev)
 
 		ret = cpuidle_register_device(device);
 		if (ret) {
-			printk(KERN_ERR "CPUidle register device failed\n");
+			dev_err(&pdev->dev, "failed to register cpuidle device\n");
 			return ret;
 		}
 	}
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/2 ARM: EXYNOS: Remove incorrect __init annotation from cpuidle driver

When platform_driver_probe() is not used, bind/unbind via sysfs is enabled. Thus, __init annotation should be removed from probe(). Also, this patch fixes section mismatch warning.

---
- Based against pm-cpuidle branch
- Tested on Exynos5440

 arch/arm/mach-exynos/cpuidle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-exynos/cpuidle.c +1 -1
index 6616e0f..ddbfe87 100644
@@ -193,7 +193,7 @@ static void __init exynos5_core_down_clk(void)
 	__raw_writel(tmp, EXYNOS5_PWR_CTRL2);
 }
 
-static int __init exynos_cpuidle_probe(struct platform_device *pdev)
+static int exynos_cpuidle_probe(struct platform_device *pdev)
 {
 	int cpu_id, ret;
 	struct cpuidle_device *device;
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 1/2 ARM: EXYNOS: Use dev_err() instead of printk() for cpuidle driver

In reply to Jingoo Han
Quoted 4 lines · Jingoo Han

Change raw printk() call to dev_err() to provide a better message to userspace so it can properly identify the device.

Both [1-2/2] queued up for 3.13, thanks!

Quoted 30 lines

---
- Based against pm-cpuidle branch
- Tested on Exynos5440

 arch/arm/mach-exynos/cpuidle.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-exynos/cpuidle.c +2 -2
index 1bde6ad..6616e0f 100644
@@ -206,7 +206,7 @@ static int __init exynos_cpuidle_probe(struct platform_device *pdev)
 
 	ret = cpuidle_register_driver(&exynos4_idle_driver);
 	if (ret) {
-		printk(KERN_ERR "CPUidle failed to register driver\n");
+		dev_err(&pdev->dev, "failed to register cpuidle driver\n");
 		return ret;
 	}
 
@@ -220,7 +220,7 @@ static int __init exynos_cpuidle_probe(struct platform_device *pdev)
 
 		ret = cpuidle_register_device(device);
 		if (ret) {
-			printk(KERN_ERR "CPUidle register device failed\n");
+			dev_err(&pdev->dev, "failed to register cpuidle device\n");
 			return ret;
 		}
 	}
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.