Skip to contentSkip to conversation

clk: scpi: Fix checking return value of platform_device_register_simple()

PATCH Applied Axel Lin 3 participants 4 messages Dec 4, 2015 – Jan 30, 2016

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

platform_device_register_simple() returns ERR_PTR on error.

---
 drivers/clk/clk-scpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-scpi.c +1 -1
index cd0f272..89e9ca7 100644
@@ -299,7 +299,7 @@ static int scpi_clocks_probe(struct platform_device *pdev)
 	/* Add the virtual cpufreq device */
 	cpufreq_dev = platform_device_register_simple("scpi-cpufreq",
 						      -1, NULL, 0);
-	if (!cpufreq_dev)
+	if (IS_ERR(cpufreq_dev))
 		pr_warn("unable to register cpufreq device");
 
 	return 0;
Signature · 1 line
2.1.4
#2 lore raw

Hi Stephen, Mike,

Quoted 4 lines · Sudeep Holla

Hi Stephen, Mike,

Can you pick up this fix for your next pull request ?

This seem to have got lost in the noise during holidays, can you please pick this up ?

Quoted 7 lines · Axel Lin
Quoted 3 lines

platform_device_register_simple() returns ERR_PTR on error.

Signature · 2 lines
Regards,
Sudeep
Applied
#3 lore raw
In reply to Axel Lin
Quoted 4 lines · Axel Lin

platform_device_register_simple() returns ERR_PTR on error.

---

Applied to clk-fixes

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project