Skip to contentSkip to conversation

clk: sunxi: Fix return value check in sun8i_a23_mbus_setup()

PATCH New weiyj_lk at 163.com 2 participants 2 messages Jul 6, 2016 – Jul 9, 2016

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

PATCH 1/1 clk: sunxi: Fix return value check in sun8i_a23_mbus_setup()

From: Wei Yongjun <[email protected]>

In case of error, the function of_io_request_and_map() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

---
 drivers/clk/sunxi/clk-sun8i-mbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi/clk-sun8i-mbus.c +1 -1
index 411d303..b200ebf 100644
@@ -48,7 +48,7 @@ static void __init sun8i_a23_mbus_setup(struct device_node *node)
 		return;
 
 	reg = of_io_request_and_map(node, 0, of_node_full_name(node));
-	if (!reg) {
+	if (IS_ERR(reg)) {
 		pr_err("Could not get registers for sun8i-mbus-clk\n");
 		goto err_free_parents;
 	}
#1 lore raw

PATCH 1/1 clk: sunxi: Fix return value check in sun8i_a23_mbus_setup()

Quoted 7 lines · On Wed, Jul 06, 2016 at 12:21:47PM +0000, weiyj_lk at 163.com wrote:

From: Wei Yongjun <[email protected]>

In case of error, the function of_io_request_and_map() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().

Applied, thanks

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160709/24828146/attachment-0001.sig>