Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6260648imu; Mon, 21 Jan 2019 06:02:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN6U2baviazWagBKEaVWEa9tuOB1YNYjfX5776M4neoaBQqbA9a9RHGTNnRf+meWiiyGYwnT X-Received: by 2002:a62:190e:: with SMTP id 14mr29704314pfz.70.1548079322983; Mon, 21 Jan 2019 06:02:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548079322; cv=none; d=google.com; s=arc-20160816; b=WQLbV7tk/eJMETz8Qr7PvhcYtOdKG7UqEJga0uUqDP9Fnf3JRF/g4VvbURgPzvPML8 LQPfmxGuUyZBh/ZD83/HdimxzwhzvHEga04XydEABcrEc0hL9sl9OmE8h77J4Dy8nOXP I36GDOnh+y+HaIFw/a17KIHL0qK4INZi1g2CGdFsXoL2E8X3+RlDz9639q83+DmFuWb2 ck0LQqCFelXU5ibQwPe1MRNCKelS1fflEEUgxrVo1x5uxySo+vjufBUhNGVm/LvydJgz erTuGvGD8ghx/9gRFELFFJgL4IUh3DDT26UD0n/zT3jgwk4f7t5Rj7PR2mgMuGA1yy1V orDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9QHm9nJAPtFFgKvYFEotYnXFKi6nxYGnIUogpu8Cx/U=; b=mXKlRvfoquJrhXFEuZ6xfzNH+7v248NKM81pshsIULA+7IfQoYRZvoZCJzg8/X28x4 0kuPpNzed62ixVSl70gqmjhL3nZB8/1MTivyqEglFH7FtJwoO7lEa3uJ2T8vmltjGE9e lLqA8tjTH8S4cBW0HLWADX4/fGb20jU/vxKRtOdNoqIGODn5wv1AD0rpdU19yn6X8ZvZ 3xXq1oRMTxdLL8YdI3kGk92dnDZ9HEyagQCYabMXsS4uvzn6CkhaL20Lnd/jFlRvP6A9 81ADGAO8afbrquoLZFzfuznDVbqUE9CXiT2A1E1Wr/bOYzBJ+47jYMUQg7J+XQRCZFC1 /sOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C5aFeZJq; 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 b12si12395209pls.32.2019.01.21.06.01.47; Mon, 21 Jan 2019 06:02:02 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=C5aFeZJq; 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 S1732145AbfAUN7M (ORCPT + 99 others); Mon, 21 Jan 2019 08:59:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:45106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729485AbfAUN7K (ORCPT ); Mon, 21 Jan 2019 08:59:10 -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 38ED02084C; Mon, 21 Jan 2019 13:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548079149; bh=HsfQMWgCE02UJ31MTxOpws29BPUEdNSf/yDJKookEsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C5aFeZJqoU1ttLNtRh7P1qUsAHiPL/aKNCDVQzJk1x3P0SURPlYXhPjs2AJHkG6mB wfMjAaBK1UFRpu/WfrCdAR6Du2eHiaJI4EhHEirD8HzxloCwtsRSUN2YpKOe72YQSq JR2IxlxpuWjHOk8n4D7oR2FU2lPWAUeazrDKafZc= 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.19 25/99] lan743x: Remove phy_read from link status change function Date: Mon, 21 Jan 2019 14:48:17 +0100 Message-Id: <20190121134914.858908425@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121134913.924726465@linuxfoundation.org> References: <20190121134913.924726465@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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-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,