From: Axel Lin Date: Fri, 4 Dec 2015 06:51:36 +0000 (+0800) Subject: clk: scpi: Fix checking return value of platform_device_register_simple() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d22eb66b3cc3d7d486bc9fa8c6fdbce197eede5f;p=openwrt%2Fstaging%2Fblogic.git clk: scpi: Fix checking return value of platform_device_register_simple() platform_device_register_simple() returns ERR_PTR on error. Signed-off-by: Axel Lin Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c index cd0f2726f5e0..89e9ca78bb94 100644 --- a/drivers/clk/clk-scpi.c +++ b/drivers/clk/clk-scpi.c @@ -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;