Received: by 10.213.65.68 with SMTP id h4csp305736imn; Fri, 23 Mar 2018 05:11:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELs0MI/53VWObbzmvl9/HRt1tIgvxibIrbOr7QBFWiNDHGr92/JRsyEvBa53t/tYhCqOSTUd X-Received: by 10.101.100.200 with SMTP id t8mr3523861pgv.358.1521807073402; Fri, 23 Mar 2018 05:11:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521807073; cv=none; d=google.com; s=arc-20160816; b=Sci6ymrKjQfTeslEQ+P4p3S2iTKOyEpLtzPPGj8fTZi4dmx0e74jztj47yl/ZCIzPJ 2CV9XDDJseGqbeCEETMbBMygQ2CU2gMMF6okbRbRJUVTt/BEnlykGZ0mVtL9UT+Z5OLN j0Xubc3miR2Pu0kxpctDxCjWuRxigbrgs73Rbw+t58I1TjVWjK7XVuRlGnQiui6wGWka AWC2m8r3vDYwi5hHQycQTxTAr+r29ohtKViwsLy4XJhPSHMZXqIhHyrXo7AucYZEucJ1 baxOlUTBpDt6Bo7+l+Jrs9k5qCOUz+hvmDGvMQi+ozIWowDnWusy8oa8gmHe72nDeSxV RZ8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=t/SRSFMz4+wP8t9b5rEfDH5Zmsu3vFAIN24D0g6BiFI=; b=VTMWSCLAt890+lLBD4F1GPw7FeGbk+/p7alIhQxk+FrpWeipJTbknvLNV9iS5ZVgTY t83vormlC33UTK8fYEQcPpYs0X2/lZmrabLKUmJLEryoNywuD7GKhBy3eNXIwb6Os2ab OAmi+bRDgVbgyhAhBa9SpIpDl/kTzjc+RrheH5+cPFyD5umLTlayaCTFloc1shlzq+TT rdBlr24T5AVj1hphUBWo8KvQqhUnFUgK4bNGxSYLpk4wtPwEnsllj/69KO3YykcgejwO htZlqoFcmZN91uLFaQRvH+RDt2+NVoECMJOuz/mrcXtSBv10msuq2MtIjZy2Yyu6xzlS rm8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si6448749pfg.298.2018.03.23.05.10.58; Fri, 23 Mar 2018 05:11:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753315AbeCWMKL (ORCPT + 99 others); Fri, 23 Mar 2018 08:10:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35562 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404AbeCWJ6F (ORCPT ); Fri, 23 Mar 2018 05:58:05 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4B19F1196; Fri, 23 Mar 2018 09:58:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , "David S. Miller" , Sasha Levin Subject: [PATCH 4.15 36/84] sfp: fix non-detection of PHY Date: Fri, 23 Mar 2018 10:53:50 +0100 Message-Id: <20180323095417.359956382@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323095411.913234798@linuxfoundation.org> References: <20180323095411.913234798@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Russell King [ Upstream commit 20b56ed9f8adfb9a7fb1c878878c54aa4ed645c1 ] The detection of a PHY changed in commit e98a3aabf85f ("mdio_bus: don't return NULL from mdiobus_scan()") which now causes sfp to print an error message. Update for this change. Fixes: 73970055450e ("sfp: add SFP module support") Signed-off-by: Russell King Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/sfp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -315,12 +315,12 @@ static void sfp_sm_probe_phy(struct sfp msleep(T_PHY_RESET_MS); phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR); - if (IS_ERR(phy)) { - dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy)); + if (phy == ERR_PTR(-ENODEV)) { + dev_info(sfp->dev, "no PHY detected\n"); return; } - if (!phy) { - dev_info(sfp->dev, "no PHY detected\n"); + if (IS_ERR(phy)) { + dev_err(sfp->dev, "mdiobus scan returned %ld\n", PTR_ERR(phy)); return; }