From patchwork Thu Jan 3 01:10:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 10746869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C70217D2 for ; Thu, 3 Jan 2019 01:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C2A928409 for ; Thu, 3 Jan 2019 01:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 804D228417; Thu, 3 Jan 2019 01:12:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0880528409 for ; Thu, 3 Jan 2019 01:12:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728605AbfACBLN (ORCPT ); Wed, 2 Jan 2019 20:11:13 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:45203 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbfACBLM (ORCPT ); Wed, 2 Jan 2019 20:11:12 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 43VVH05Wfbz1qvTP; Thu, 3 Jan 2019 02:11:08 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 43VVH05L3wz1qvWb; Thu, 3 Jan 2019 02:11:08 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id K2vANrW6oYr8; Thu, 3 Jan 2019 02:11:07 +0100 (CET) X-Auth-Info: BwJ4C2Tv+LxrvbyYfVMeQJoSk8cuDF5E49CIeyB/9lk= Received: from kurokawa.lan (ip-86-49-110-70.net.upcbroadband.cz [86.49.110.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 3 Jan 2019 02:11:07 +0100 (CET) From: Marek Vasut To: netdev@vger.kernel.org Cc: Marek Vasut , "David S . Miller" , Nisar Sayed , Woojung Huh , Andrew Lunn , Florian Fainelli , linux-usb@vger.kernel.org Subject: [PATCH 04/19] usbnet: smsc95xx: Remove __smsc95xx_{read,write}_reg() Date: Thu, 3 Jan 2019 02:10:25 +0100 Message-Id: <20190103011040.25974-5-marex@denx.de> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20190103011040.25974-1-marex@denx.de> References: <20190103011040.25974-1-marex@denx.de> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Inline those functions into smsc95xx_{read,write}_reg() to get rid of the wrapper. Signed-off-by: Marek Vasut Cc: David S. Miller Cc: Nisar Sayed Cc: Woojung Huh Cc: Andrew Lunn Cc: Florian Fainelli Cc: linux-usb@vger.kernel.org To: netdev@vger.kernel.org --- drivers/net/usb/smsc95xx.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 7200f40511b6..6c48fec2e5b5 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -87,8 +87,8 @@ static int smsc95xx_in_pm(struct usbnet *dev) return dev->suspend_count != 0; } -static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, - u32 *data) +static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, + u32 *data) { u32 buf; int ret; @@ -116,8 +116,8 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, return ret; } -static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index, - u32 data) +static int __must_check smsc95xx_write_reg(struct usbnet *dev, u32 index, + u32 data) { u32 buf; int ret; @@ -143,18 +143,6 @@ static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index, return ret; } -static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, - u32 *data) -{ - return __smsc95xx_read_reg(dev, index, data); -} - -static int __must_check smsc95xx_write_reg(struct usbnet *dev, u32 index, - u32 data) -{ - return __smsc95xx_write_reg(dev, index, data); -} - /* Loop until the read is completed with timeout * called with phy_mutex held */ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev) @@ -164,7 +152,7 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev) int ret; do { - ret = __smsc95xx_read_reg(dev, MII_ADDR, &val); + ret = smsc95xx_read_reg(dev, MII_ADDR, &val); if (ret < 0) { netdev_warn(dev->net, "Error reading MII_ACCESS\n"); return ret; @@ -196,7 +184,7 @@ static int __smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx) phy_id &= dev->mii.phy_id_mask; idx &= dev->mii.reg_num_mask; addr = (phy_id << 11) | (idx << 6) | MII_READ_ | MII_BUSY_; - ret = __smsc95xx_write_reg(dev, MII_ADDR, addr); + ret = smsc95xx_write_reg(dev, MII_ADDR, addr); if (ret < 0) { netdev_warn(dev->net, "Error writing MII_ADDR\n"); goto done; @@ -208,7 +196,7 @@ static int __smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx) goto done; } - ret = __smsc95xx_read_reg(dev, MII_DATA, &val); + ret = smsc95xx_read_reg(dev, MII_DATA, &val); if (ret < 0) { netdev_warn(dev->net, "Error reading MII_DATA\n"); goto done; @@ -238,7 +226,7 @@ static void __smsc95xx_mdio_write(struct net_device *netdev, int phy_id, } val = regval; - ret = __smsc95xx_write_reg(dev, MII_DATA, val); + ret = smsc95xx_write_reg(dev, MII_DATA, val); if (ret < 0) { netdev_warn(dev->net, "Error writing MII_DATA\n"); goto done; @@ -248,7 +236,7 @@ static void __smsc95xx_mdio_write(struct net_device *netdev, int phy_id, phy_id &= dev->mii.phy_id_mask; idx &= dev->mii.reg_num_mask; addr = (phy_id << 11) | (idx << 6) | MII_WRITE_ | MII_BUSY_; - ret = __smsc95xx_write_reg(dev, MII_ADDR, addr); + ret = smsc95xx_write_reg(dev, MII_ADDR, addr); if (ret < 0) { netdev_warn(dev->net, "Error writing MII_ADDR\n"); goto done; @@ -972,7 +960,7 @@ static int smsc95xx_start_rx_path(struct usbnet *dev) pdata->mac_cr |= MAC_CR_RXEN_; spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); - return __smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); + return smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); } static int smsc95xx_phy_initialize(struct usbnet *dev)