From patchwork Fri Sep 28 05:04:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 187717 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D6EFB2C00C7 for ; Fri, 28 Sep 2012 15:04:25 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751077Ab2I1FEX (ORCPT ); Fri, 28 Sep 2012 01:04:23 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:55885 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753Ab2I1FEW (ORCPT ); Fri, 28 Sep 2012 01:04:22 -0400 Received: by qaas11 with SMTP id s11so1465528qaa.19 for ; Thu, 27 Sep 2012 22:04:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=RujxbIBpdIi//jE5SL3zpMysccQ/nfG6ReS/qfx3eMA=; b=wJUaLvbpasf3DOPIGp44lQKXoD3vofu+xtIAmpgjztsa8EJOV8NsrVX5udIQq9NxqT 3UPnvv17raZcybJD82NeG2axzM41efNmeVQu0m8Uvfw6nuLWnbL3gHwO3p3CukaUvCcV rYrJ1e2opq40S+9bZez2YUIg2NKSFlDGGK/gWqzl7Xkcs7gzTlRDAdW+xjJkGEjTdvyF Zm8+vbzKNEDBZTU63PQvxqSAKyW3UbUgFwJMUtJ0mvmUz4L3LPH4w10mAx7jOBxLTPqV F7bnmTnVr5gZxiZ6cjwV6UERUYlA4FKbXC0t9KqB3u/JOzW8WO++MxpY7ZeZPyglMDm+ Z0JQ== MIME-Version: 1.0 Received: by 10.224.179.7 with SMTP id bo7mr14438885qab.96.1348808661864; Thu, 27 Sep 2012 22:04:21 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Thu, 27 Sep 2012 22:04:21 -0700 (PDT) Date: Fri, 28 Sep 2012 13:04:21 +0800 Message-ID: Subject: [PATCH] netdev: octeon: fix return value check in octeon_mgmt_init_phy() From: Wei Yongjun To: grant.likely@secretlab.ca, rob.herring@calxeda.com Cc: yongjun_wei@trendmicro.com.cn, netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Wei Yongjun In case of error, the function of_phy_connect() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- drivers/net/ethernet/octeon/octeon_mgmt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c index c42bbb1..a688a2d 100644 --- a/drivers/net/ethernet/octeon/octeon_mgmt.c +++ b/drivers/net/ethernet/octeon/octeon_mgmt.c @@ -722,10 +722,8 @@ static int octeon_mgmt_init_phy(struct net_device *netdev) octeon_mgmt_adjust_link, 0, PHY_INTERFACE_MODE_MII); - if (IS_ERR(p->phydev)) { - p->phydev = NULL; + if (!p->phydev) return -1; - } phy_start_aneg(p->phydev);