Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8d68f88 authored by Wei Yongjun's avatar Wei Yongjun Committed by Felipe Balbi
Browse files

usb: phy: phy-generic: fix return value check in usb_nop_xceiv_register()



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

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a535d81c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -48,8 +48,9 @@ void usb_nop_xceiv_register(void)
	if (pd)
	if (pd)
		return;
		return;
	pd = platform_device_register_simple("usb_phy_gen_xceiv", -1, NULL, 0);
	pd = platform_device_register_simple("usb_phy_gen_xceiv", -1, NULL, 0);
	if (!pd) {
	if (IS_ERR(pd)) {
		pr_err("Unable to register generic usb transceiver\n");
		pr_err("Unable to register generic usb transceiver\n");
		pd = NULL;
		return;
		return;
	}
	}
}
}