From patchwork Sat Feb 17 00:04:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 874711 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bMhjh4XI"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zjqyM40BYz9sRW for ; Sat, 17 Feb 2018 11:04:59 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 19468C220DB; Sat, 17 Feb 2018 00:04:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 39FE8C2204F; Sat, 17 Feb 2018 00:04:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7671FC2204D; Sat, 17 Feb 2018 00:04:49 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by lists.denx.de (Postfix) with ESMTPS id EEA4AC21D72 for ; Sat, 17 Feb 2018 00:04:48 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id u15so4456822wrg.3 for ; Fri, 16 Feb 2018 16:04:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=W8FM5FFm0aJfIDf/L5BC1bi2w+/giD1ceKIrCfwkgqA=; b=bMhjh4XIa5AM7wGcS/klByT8rsxSQUz6JO+sI1ZCeNhcB4DjdZyh3Ytnua6fguUZg/ 02x+9+J/xR8u2OnbCyBXu4a/CgqPsw2Tj6MAbwhFjParEycSbY42cAnJt7oXIiSuWNjS +3Wpxo3ZI4BhJYcJdkIuO+xmnd7WjHCJbIj0RhQVjAQQRge7PMTIQ645dzSa2tjATGrR xzjjaj43jvrlD83dA7tPG4GOkXw8KNovQBX8etFESbZZnlpZrc+EdN12OvsYRLsPRIMP 7Xe793GapJ6R1/9crwfgHQVWsDF2PCvczMNHFMCRPMha4aN0MOcEGwIbxQIA4MND0XLR 7tfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=W8FM5FFm0aJfIDf/L5BC1bi2w+/giD1ceKIrCfwkgqA=; b=gl4E4lCZ2Rj/8X+fsr1rhWfKqvBcMcJwhdyDvJa9M8mBcUz1p9tbofhLO6smKZSbZ8 6hRezqMGlQFD2y956I9xj7K5glW2746y3Q5Pv9ii3d/L4e2S/f0ePU6YkiZFeCG2/fuo 9G/HisUn3dypBthZzLOFqJqzXhoSuxquO+5DCGz2nyD7QdKkew7BT1hyqjlDw/VRKrhs Hw9xZvD0cFYmcg+XdC+yPwRwXXV7qH+c0y2oVO7RA4ybQrEZ1Z6ijRehysfx9/O21fqB KJKxSla31yrM4mHVD2pqdS8aSC58htcX4eH5BBJBahqbAqQBLb1oz7dXiAZvkl/TX1Pn NZ2A== X-Gm-Message-State: APf1xPDmQn1dvjk5cTWFgUz74cq8r2UOHCCnxy6uNjQVfqlclA94zYwb 24xSPehay+s43iVs2WphHS7gMpe+ X-Google-Smtp-Source: AH8x224vLm6AseRetsN0KpOdcdtyqGBaJkh8PHPL99/1VC+/8i+ldCiWSiECjpu+xVJ1OfhHR39T+Q== X-Received: by 10.223.169.4 with SMTP id u4mr6485045wrc.170.1518825888292; Fri, 16 Feb 2018 16:04:48 -0800 (PST) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id r68sm5927095wmr.14.2018.02.16.16.04.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 16:04:47 -0800 (PST) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Date: Sat, 17 Feb 2018 01:04:41 +0100 Message-Id: <20180217000444.8375-1-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.15.1 Cc: Joe Hershberger , Marek Vasut Subject: [U-Boot] [PATCH 1/4] net: sh_eth: Zap port variable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Inline this variable which is quite useless. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Cc: Joe Hershberger Acked-by: Joe Hershberger --- drivers/net/sh_eth.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 5a5c6bc39e..b3c0509989 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -63,8 +63,8 @@ static int sh_eth_send_common(struct sh_eth_dev *eth, void *packet, int len) { - int port = eth->port, ret = 0, timeout; - struct sh_eth_info *port_info = ð->port_info[port]; + int ret = 0, timeout; + struct sh_eth_info *port_info = ð->port_info[eth->port]; if (!packet || len > 0xffff) { printf(SHETHER_NAME ": %s: Invalid argument\n", __func__); @@ -120,8 +120,8 @@ err: static int sh_eth_recv_start(struct sh_eth_dev *eth) { - int port = eth->port, len = 0; - struct sh_eth_info *port_info = ð->port_info[port]; + int len = 0; + struct sh_eth_info *port_info = ð->port_info[eth->port]; /* Check if the rx descriptor is ready */ invalidate_cache(port_info->rx_desc_cur, sizeof(struct rx_desc_s)); @@ -192,9 +192,9 @@ static int sh_eth_reset(struct sh_eth_dev *eth) static int sh_eth_tx_desc_init(struct sh_eth_dev *eth) { - int port = eth->port, i, ret = 0; + int i, ret = 0; u32 alloc_desc_size = NUM_TX_DESC * sizeof(struct tx_desc_s); - struct sh_eth_info *port_info = ð->port_info[port]; + struct sh_eth_info *port_info = ð->port_info[eth->port]; struct tx_desc_s *cur_tx_desc; /* @@ -245,9 +245,9 @@ err: static int sh_eth_rx_desc_init(struct sh_eth_dev *eth) { - int port = eth->port, i, ret = 0; + int i, ret = 0; u32 alloc_desc_size = NUM_RX_DESC * sizeof(struct rx_desc_s); - struct sh_eth_info *port_info = ð->port_info[port]; + struct sh_eth_info *port_info = ð->port_info[eth->port]; struct rx_desc_s *cur_rx_desc; u8 *rx_buf; @@ -318,8 +318,7 @@ err: static void sh_eth_tx_desc_free(struct sh_eth_dev *eth) { - int port = eth->port; - struct sh_eth_info *port_info = ð->port_info[port]; + struct sh_eth_info *port_info = ð->port_info[eth->port]; if (port_info->tx_desc_alloc) { free(port_info->tx_desc_alloc); @@ -329,8 +328,7 @@ static void sh_eth_tx_desc_free(struct sh_eth_dev *eth) static void sh_eth_rx_desc_free(struct sh_eth_dev *eth) { - int port = eth->port; - struct sh_eth_info *port_info = ð->port_info[port]; + struct sh_eth_info *port_info = ð->port_info[eth->port]; if (port_info->rx_desc_alloc) { free(port_info->rx_desc_alloc); @@ -523,7 +521,7 @@ static int sh_eth_start_common(struct sh_eth_dev *eth) static int sh_eth_phy_config_legacy(struct sh_eth_dev *eth) { int port = eth->port, ret = 0; - struct sh_eth_info *port_info = ð->port_info[port]; + struct sh_eth_info *port_info = ð->port_info[eth->port]; struct eth_device *dev = port_info->dev; struct phy_device *phydev; @@ -546,7 +544,7 @@ static int sh_eth_send_legacy(struct eth_device *dev, void *packet, int len) static int sh_eth_recv_common(struct sh_eth_dev *eth) { int port = eth->port, len = 0; - struct sh_eth_info *port_info = ð->port_info[port]; + struct sh_eth_info *port_info = ð->port_info[eth->port]; uchar *packet = (uchar *)ADDR_TO_P2(port_info->rx_desc_cur->rd2); len = sh_eth_recv_start(eth); @@ -750,8 +748,8 @@ static int sh_eth_phy_config(struct udevice *dev) struct sh_ether_priv *priv = dev_get_priv(dev); struct eth_pdata *pdata = dev_get_platdata(dev); struct sh_eth_dev *eth = &priv->shdev; - int port = eth->port, ret = 0; - struct sh_eth_info *port_info = ð->port_info[port]; + int ret = 0; + struct sh_eth_info *port_info = ð->port_info[eth->port]; struct phy_device *phydev; int mask = 0xffffffff; From patchwork Sat Feb 17 00:04:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 874713 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Qr2kj0cb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zjqzx4HCWz9sRW for ; Sat, 17 Feb 2018 11:06:21 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 34B3DC22126; Sat, 17 Feb 2018 00:05:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2E59BC220A5; Sat, 17 Feb 2018 00:04:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3ED48C2204D; Sat, 17 Feb 2018 00:04:50 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by lists.denx.de (Postfix) with ESMTPS id D09F7C21D72 for ; Sat, 17 Feb 2018 00:04:49 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id l43so4459632wrc.2 for ; Fri, 16 Feb 2018 16:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1otWhF12gEm8hAIngyqxCNWRZT2kxu8aEw6HTeg7LRw=; b=Qr2kj0cbQZd9/gEZwKZc+tELm2XXYNN+GkbySmvWCCo9+UH6xZMJdu8VaxLVCI0kUd VvnjWKcFeLTUc9Ht+YP0IrkzpbikcdXIfHKPsYZzTSVV/bJZ8OqvkHB5hI6/6n8kr0Hr gmk7gLl8Ux4YdSehSvGASfJCgjzSGaRMP3t4lot6yYxhVfakPiaFeO6rXlu4DVTBSNG7 vAhj+igl7vTWezuaR6leKmqrszt44r/XvecNxZegX8f51RFtzn50YIQuUfXB7sqhpV29 QD0iZU8ViVLCmY4qRmU4FIdDGISqJNbQaSTsVz8PUHtjISZeoLZ24/sWQiMXs/hwqstL r94Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1otWhF12gEm8hAIngyqxCNWRZT2kxu8aEw6HTeg7LRw=; b=GipMWZe7ulu08pnUbK/0aAccHZDiV0R3ZENiK4M+3arcg0nm4TjcEToUizq8j+QqS+ Co7Wl4bngb8OiHD8cO1IjYYL5A7HB4ahzY0dSEeaRcY/6jeBRSyC9JfKlmuian+ozZCd gzqKXSzb4lUcKJmwLezeANzen3vPCj7JAPJmYepMiQegUYIu5R0huka0pMCNoIDItmRP m1/KzRb8Wjc5yp8DC95n4WUujmxClDEoxcWuaJaML/k/N+frSGcqbwsbpCeUqMCDOQBR Ia0yWh9c5kyo375wDazfAE+JjlMI5rA6OB70dfDvZlA6ZPr3ScidJxtyxNpxkNqng6ph 9Utg== X-Gm-Message-State: APf1xPCUKT4OHK5kTJyn9DHH7CMfUgMGN7S4jLatrql+xsuNnCAm8rff z7FmYDB2Np3zrH/hXdXJ1sykVwNw X-Google-Smtp-Source: AH8x2260pKKMtb7RBxy6rO0Lc3qATxZuO5YlIjZgJU3IiQe6oC+WVH9+fkP2jYPII6VX0Ygm5b9yGg== X-Received: by 10.223.184.147 with SMTP id i19mr6812059wrf.102.1518825889218; Fri, 16 Feb 2018 16:04:49 -0800 (PST) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id r68sm5927095wmr.14.2018.02.16.16.04.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 16:04:48 -0800 (PST) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Date: Sat, 17 Feb 2018 01:04:42 +0100 Message-Id: <20180217000444.8375-2-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180217000444.8375-1-marek.vasut+renesas@gmail.com> References: <20180217000444.8375-1-marek.vasut+renesas@gmail.com> Cc: Joe Hershberger , Marek Vasut Subject: [U-Boot] [PATCH 2/4] net: sh_eth: Return directly from sh_eth_recv_start X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Drop the len variable, it's useless. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Cc: Joe Hershberger Acked-by: Joe Hershberger --- drivers/net/sh_eth.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index b3c0509989..bdb054a36a 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -120,7 +120,6 @@ err: static int sh_eth_recv_start(struct sh_eth_dev *eth) { - int len = 0; struct sh_eth_info *port_info = ð->port_info[eth->port]; /* Check if the rx descriptor is ready */ @@ -132,9 +131,7 @@ static int sh_eth_recv_start(struct sh_eth_dev *eth) if (port_info->rx_desc_cur->rd0 & RD_RFE) return -EINVAL; - len = port_info->rx_desc_cur->rd1 & 0xffff; - - return len; + return port_info->rx_desc_cur->rd1 & 0xffff; } static void sh_eth_recv_finish(struct sh_eth_dev *eth) From patchwork Sat Feb 17 00:04:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 874712 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UyMmEdWV"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zjqz65fyRz9sRW for ; Sat, 17 Feb 2018 11:05:38 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 6A192C2210A; Sat, 17 Feb 2018 00:05:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 42DE2C220F0; Sat, 17 Feb 2018 00:04:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 72281C2206D; Sat, 17 Feb 2018 00:04:51 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by lists.denx.de (Postfix) with ESMTPS id 05788C21D72 for ; Sat, 17 Feb 2018 00:04:51 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id s5so4473665wra.0 for ; Fri, 16 Feb 2018 16:04:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=05HllpASqO3xtIsyl8M6GTNc12s+FQ/0L/TO7niUUQo=; b=UyMmEdWVAs8ZI0tmNfnreptmd2XSZ1wg9neTqyfm+YMXuH2ciwgFrNv/tt6gNp275k 97JK33aAgAf0KIjk/E6oT1KadLJArmAsTPTnvjk0iFYLNGxu3DM8qRdqI1sUOGAtwWL2 V6R/z3durRSXdJmZNUhDZydhM6tWuQUByRpcAFMQWgqgenJJ5/DNnde0gOEvd720HTgu yyA/AODrVGGD0cu/RviqnWobarGe0ak+HGcfKpBc3dQ/KyqT9Ey4GFaF/fcxp+BL5yXF sHWmYrJLliMtp+Xrj4kb5UWduQa3k3v5sFFkZMQk+bG1+6FrQM6fS/GmgkvidFnC0IR7 hlcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=05HllpASqO3xtIsyl8M6GTNc12s+FQ/0L/TO7niUUQo=; b=XrSUoQJ1XaCHetHGAznKjX34IQa15d2iZ5o2c28vt1JvMNpQOE8lUHyAZFumNBO40z tbRkWvrrd4sIPyv/+U6yPqbICNDYY2CIwNrJvmYAp+7WiTUfULYm9W7DC8fzaa2P/toU qelfCpqh5FTCRAcwpMVS+7UJzKQZrlJsrWerPDNbJx7Rk+1arZ/HP5dvFbeIcrmnfIrL quIVpXpXhtLiLwk8/KkJGY8xt3wXB0bDboI1IgI0oudXKjE9BWZalszFl7L24q2xzxMg Cxra9apsZsuxqrWUlXy8fKRS7SrM0k3P+Zye7Dq8FUGls4qJE8GyjvNi0+0qgEaYxlTJ prvg== X-Gm-Message-State: APf1xPAF/bUDOZUM9OuE6qmzEMrwx1eUrQRjkCdaYLpixpR+ymuMiJhm Xvv28bV4JUv7RqgWvPe2BbgKpt8l X-Google-Smtp-Source: AH8x224MZSr2kSeNaOeKvcbffr8vJgXHp2S4ivEyXrgydCVghxCwCkYlYpiwnAh823PVEtGgzwrWSA== X-Received: by 10.223.179.5 with SMTP id j5mr6154333wrd.112.1518825890383; Fri, 16 Feb 2018 16:04:50 -0800 (PST) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id r68sm5927095wmr.14.2018.02.16.16.04.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 16:04:49 -0800 (PST) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Date: Sat, 17 Feb 2018 01:04:43 +0100 Message-Id: <20180217000444.8375-3-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180217000444.8375-1-marek.vasut+renesas@gmail.com> References: <20180217000444.8375-1-marek.vasut+renesas@gmail.com> Cc: Joe Hershberger , Marek Vasut Subject: [U-Boot] [PATCH 3/4] net: sh_eth: Fix checkpatch warning X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Fix minor checkpatch warning about udelay(3000) being too long and should be replaced by mdelay(3). Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Cc: Joe Hershberger Acked-by: Joe Hershberger --- drivers/net/sh_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index bdb054a36a..252c6279b0 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -179,7 +179,7 @@ static int sh_eth_reset(struct sh_eth_dev *eth) return ret; #else sh_eth_write(port_info, sh_eth_read(port_info, EDMR) | EDMR_SRST, EDMR); - udelay(3000); + mdelay(3); sh_eth_write(port_info, sh_eth_read(port_info, EDMR) & ~EDMR_SRST, EDMR); From patchwork Sat Feb 17 00:04:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 874714 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mYXUp/39"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zjr0x3m43z9sRW for ; Sat, 17 Feb 2018 11:07:13 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 3DC8EC22071; Sat, 17 Feb 2018 00:05:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 602F6C2206D; Sat, 17 Feb 2018 00:05:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1FB41C22108; Sat, 17 Feb 2018 00:04:56 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by lists.denx.de (Postfix) with ESMTPS id 04EAAC2208F for ; Sat, 17 Feb 2018 00:04:52 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id v65so4420716wrc.11 for ; Fri, 16 Feb 2018 16:04:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i4IEHbiIvB4A3cGaREU2EMJKb4D+Mj/FAH1s/OIfG+w=; b=mYXUp/39c4TMYUst9QHjIUAr4XxivmLMvZXX8GpwomZ6Uv3/9s1bDN4yNZ0V/Xu0KC XnpVZQzp3FMbUAKQvR3k/3bYONCBMKnTkkdzMy75x+ohBnsv6efp54bxCopUAgx+Gtha UJOrE5cfATb+Xa0n8BeRVKVNIPMLetk48k9P7jzqUs9BG8QMPgIvdQ9DhozHi95T8cS9 +uOWuBymiDtkm3zAUvz5p8TxMoHjOUyTSgSC5DuKiHkDdn+jcL1VF3PeDfNB8EsBQQSw 6TELaC394BzcGbyyERzb6U891ZNkOA1NTwCRasU+NziV52Vg0jFc3JQXOI+JCjmHryis seYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i4IEHbiIvB4A3cGaREU2EMJKb4D+Mj/FAH1s/OIfG+w=; b=Ie8fiCNG1dC0G58FZZspz4jwyg+I9F/1FK1IBhek/1SUMy5+RrCcuK2qBK8TgiK1ZA Llot7PENEM4HhPGTCEmj1ICiYFm61LKIE+aDO+ol0sGmY7zFCklpxaHcsdX3eVi4XHne VAHqlvDl+iR/xNJKsv337OsYd+FElrNtoZWLd1rCUxC5p/CBy6GGUXkMDrElstqLiP+P KYFuVxJFCx/TXqY95UVouQ+BVvfwRi+8z9/oQfuo8rJJ6BzMZOqXqJqW42IYHFl/Y804 PCCkkv20Q15E36wQiVGULc/el30QmbC9ems0NFpanB0cMxGQaPK6VYrz5lzYd90SyG0C pbtQ== X-Gm-Message-State: APf1xPBDNCvnDWXPMzsuVg8jxQc7eozd45Np80Rk2tVKJKELlYIHSjat z1WsGeLoYiulCgW1jiLecB726m63 X-Google-Smtp-Source: AH8x225fc9gGGcIIrR+ZmaOVkHkqZ3nlLo0RYZQaDEWNJbwvk+FxWONGBtdDgBrJolqYHJIhGobMng== X-Received: by 10.223.128.104 with SMTP id 95mr7475569wrk.139.1518825891389; Fri, 16 Feb 2018 16:04:51 -0800 (PST) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id r68sm5927095wmr.14.2018.02.16.16.04.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Feb 2018 16:04:50 -0800 (PST) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Date: Sat, 17 Feb 2018 01:04:44 +0100 Message-Id: <20180217000444.8375-4-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180217000444.8375-1-marek.vasut+renesas@gmail.com> References: <20180217000444.8375-1-marek.vasut+renesas@gmail.com> Cc: Joe Hershberger , Marek Vasut Subject: [U-Boot] [PATCH 4/4] net: sh_eth: Fix DT base address fetching X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Drop the whole map/unmap_physmem stuff and just use the address already obtained from DT in ofdata_to_platdata(), instead of repeating that, wrongly, in probe. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Cc: Joe Hershberger Acked-by: Joe Hershberger --- drivers/net/sh_eth.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 252c6279b0..850fe1587f 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -675,7 +675,7 @@ struct sh_ether_priv { struct sh_eth_dev shdev; struct mii_dev *bus; - void __iomem *iobase; + phys_addr_t iobase; struct clk clk; struct gpio_desc reset_gpio; }; @@ -811,15 +811,13 @@ static int sh_ether_probe(struct udevice *udev) struct sh_ether_priv *priv = dev_get_priv(udev); struct sh_eth_dev *eth = &priv->shdev; struct mii_dev *mdiodev; - void __iomem *iobase; int ret; - iobase = map_physmem(pdata->iobase, 0x1000, MAP_NOCACHE); - priv->iobase = iobase; + priv->iobase = pdata->iobase; ret = clk_get_by_index(udev, 0, &priv->clk); if (ret < 0) - goto err_mdio_alloc; + return ret; gpio_request_by_name(udev, "reset-gpios", 0, &priv->reset_gpio, GPIOD_IS_OUT); @@ -827,7 +825,7 @@ static int sh_ether_probe(struct udevice *udev) mdiodev = mdio_alloc(); if (!mdiodev) { ret = -ENOMEM; - goto err_mdio_alloc; + return ret; } mdiodev->read = bb_miiphy_read; @@ -850,8 +848,6 @@ static int sh_ether_probe(struct udevice *udev) err_mdio_register: mdio_free(mdiodev); -err_mdio_alloc: - unmap_physmem(priv->iobase, MAP_NOCACHE); return ret; } @@ -868,8 +864,6 @@ static int sh_ether_remove(struct udevice *udev) if (dm_gpio_is_valid(&priv->reset_gpio)) dm_gpio_free(udev, &priv->reset_gpio); - unmap_physmem(priv->iobase, MAP_NOCACHE); - return 0; }