From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B7F9C2F3A0 for ; Mon, 21 Jan 2019 14:21:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53CD720861 for ; Mon, 21 Jan 2019 14:21:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548080491; bh=ImFiMYj0fcd+RGwM3EExbDyhA2+6NEI8WCiKJD0cdF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kxqldazkrQz8EAMawKgOeh+cHkQH+vg6ovEl3vLv3dxKBQ6Sjal+q64LC04K2haF8 O+HOHMRvam1PA+rOv+N31wdWTeGA7K4KuL2Naif4//2XqZ4K5D768eofrz4vtoUHw5 lgmVpdwOyXlkpPdNwX/zfL0cJ7ttYcE4qunrkqWI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729396AbfAUNrE (ORCPT ); Mon, 21 Jan 2019 08:47:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:56104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729433AbfAUNrB (ORCPT ); Mon, 21 Jan 2019 08:47:01 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D8D9820870; Mon, 21 Jan 2019 13:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548078420; bh=ImFiMYj0fcd+RGwM3EExbDyhA2+6NEI8WCiKJD0cdF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qs8wU+v/G03W5cmc8pkpqPfZqSwwovUEBuguPQtg05iS+dDMdCmDbSrLns+LuoTd/ Cuphtb51leoFvcOCL/Hfwx5MzD9k7ih8VA+jQ+Is4p95Bu+wQE5MiZh4VqqEea9WpJ bD50hX+mkDguqJzaCYnorB7mJXmHvKt+WwdqYqI4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bryan Whitehead , Andrew Lunn , "David S. Miller" Subject: [PATCH 4.20 025/111] lan743x: Remove phy_read from link status change function Date: Mon, 21 Jan 2019 14:42:19 +0100 Message-Id: <20190121122458.553463859@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121122455.819406896@linuxfoundation.org> References: <20190121122455.819406896@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bryan Whitehead [ Upstream commit a0071840d2040ea1b27e5a008182b09b88defc15 ] It has been noticed that some phys do not have the registers required by the previous implementation. To fix this, instead of using phy_read, the required information is extracted from the phy_device structure. fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Bryan Whitehead Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/microchip/lan743x_main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c @@ -962,13 +962,10 @@ static void lan743x_phy_link_status_chan memset(&ksettings, 0, sizeof(ksettings)); phy_ethtool_get_link_ksettings(netdev, &ksettings); - local_advertisement = phy_read(phydev, MII_ADVERTISE); - if (local_advertisement < 0) - return; - - remote_advertisement = phy_read(phydev, MII_LPA); - if (remote_advertisement < 0) - return; + local_advertisement = + ethtool_adv_to_mii_adv_t(phydev->advertising); + remote_advertisement = + ethtool_adv_to_mii_adv_t(phydev->lp_advertising); lan743x_phy_update_flowcontrol(adapter, ksettings.base.duplex,