Skip to contentSkip to conversation

PM / devfreq: event: testing the wrong variable

PATCH In review Dan Carpenter 3 participants 3 messages Feb 10, 2015 – Feb 12, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM / devfreq: event: testing the wrong variable

There is a typo here so we test "edev" but we intended to test "edev[i]".

Fixes f262f28c1470 ('PM / devfreq: event: Add devfreq_event class')
drivers/devfreq/event/exynos-ppmu.c +2 -2
index 135be0a..ad83473 100644
@@ -327,8 +327,8 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
 
 	for (i = 0; i < info->num_events; i++) {
 		edev[i] = devm_devfreq_event_add_edev(&pdev->dev, &desc[i]);
-		if (IS_ERR(edev)) {
-			ret = PTR_ERR(edev);
+		if (IS_ERR(edev[i])) {
+			ret = PTR_ERR(edev[i]);
 			dev_err(&pdev->dev,
 				"failed to add devfreq-event device\n");
 			goto err;
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Dan Carpenter

There is a typo here so we test "edev" but we intended to test "edev[i]".

Fixes f262f28c1470 ('PM / devfreq: event: Add devfreq_event class')
drivers/devfreq/event/exynos-ppmu.c +0 -0
index 135be0a..ad83473 100644

drivers/devfreq/event/exynos-ppmu.c static int exynos_ppmu_probe(struct platform_device *pdev) · line 334

Quoted 10 lines
drivers/devfreq/event/exynos-ppmu.c +2 -2
@@ -327,8 +327,8 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
 
 	for (i = 0; i < info->num_events; i++) {
 		edev[i] = devm_devfreq_event_add_edev(&pdev->dev, &desc[i]);
-		if (IS_ERR(edev)) {
-			ret = PTR_ERR(edev);
+		if (IS_ERR(edev[i])) {
+			ret = PTR_ERR(edev[i]);
 			dev_err(&pdev->dev,
 				"failed to add devfreq-event device\n");
 			goto err;

But,
This patch has not yet merged to linux.git (http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git).
After releasing Linux 3.20-rc1, this patch will be handled.

Thanks,
Chanwoo Choi

maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 20 lines · Dan Carpenter
Quoted 11 lines

There is a typo here so we test "edev" but we intended to test "edev[i]".

Fixes f262f28c1470 ('PM / devfreq: event: Add devfreq_event class')
drivers/devfreq/event/exynos-ppmu.c +0 -0
index 135be0a..ad83473 100644

drivers/devfreq/event/exynos-ppmu.c static int exynos_ppmu_probe(struct platform_device *pdev) · line 328

Quoted 4 lines
drivers/devfreq/event/exynos-ppmu.c +2 -2
@@ -327,8 +327,8 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
-		if (IS_ERR(edev)) {
-			ret = PTR_ERR(edev);
+		if (IS_ERR(edev[i])) {
+			ret = PTR_ERR(edev[i]);
Quoted 6 lines

But,
This patch has not yet merged to linux.git (http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git).
After releasing Linux 3.20-rc1, this patch will be handled.

Thanks,
Chanwoo Choi