From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753915AbbAaO2a (ORCPT ); Sat, 31 Jan 2015 09:28:30 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:42407 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751702AbbAaO2Y (ORCPT ); Sat, 31 Jan 2015 09:28:24 -0500 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH 3/9] phy: fix return value check in armada375_usb_phy_probe() Date: Sat, 31 Jan 2015 19:58:10 +0530 Message-ID: <1422714496-423-4-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1422714496-423-1-git-send-email-kishon@ti.com> References: <1422714496-423-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/phy-armada375-usb2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-armada375-usb2.c b/drivers/phy/phy-armada375-usb2.c index ac7d99d..7c99ca2 100644 --- a/drivers/phy/phy-armada375-usb2.c +++ b/drivers/phy/phy-armada375-usb2.c @@ -118,8 +118,8 @@ static int armada375_usb_phy_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_MEM, 0); usb_cluster_base = devm_ioremap_resource(&pdev->dev, res); - if (!usb_cluster_base) - return -ENOMEM; + if (IS_ERR(usb_cluster_base)) + return PTR_ERR(usb_cluster_base); phy = devm_phy_create(dev, NULL, &armada375_usb_phy_ops); if (IS_ERR(phy)) { -- 1.7.9.5