From patchwork Thu Nov 30 23:08:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 843225 X-Patchwork-Delegate: joe.hershberger@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=nigauri-org.20150623.gappssmtp.com header.i=@nigauri-org.20150623.gappssmtp.com header.b="rIswR7Ib"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yntQS53txz9sNV for ; Fri, 1 Dec 2017 10:09:36 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 0F1BDC21E08; Thu, 30 Nov 2017 23:09:28 +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=RCVD_IN_DNSWL_BLOCKED, 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 AFF36C21F02; Thu, 30 Nov 2017 23:09:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2E85CC21F2B; Thu, 30 Nov 2017 23:08:20 +0000 (UTC) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by lists.denx.de (Postfix) with ESMTPS id 8B808C21E73 for ; Thu, 30 Nov 2017 23:08:16 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id u19so3777676pfa.12 for ; Thu, 30 Nov 2017 15:08:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nigauri-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=BVQ3plnJXoPLt9EbHHaAB/OPydKJ4TRhx/A/LhfR+Os=; b=rIswR7IbqEEfoWV/BEmRZjGMX+VsAlf50788/NuaAJn+YlGLYlpbMuNoOrymevmy9V IP8OHRv4kmXgq42iaLLLzOUXlcnM+48ajOn2gt+Du+hSRLT3btT6QzP6D74NzUNokVHK SwPYz6KoqpWLVlQfD1A1gJQTs4LF/v4EyAkXGZMlb0bc/vmfsG9+e20GEzfUSCst3yde NDsRQYdbe60wurwr2d+PC2thfbnaX6egTrGugdxDO798onjXU5kpY4OTi/Qut+YY4vB9 hjino2Sb8Ne9dEwFoa0epW+p+U9VVVT6JM1jUD3Yaec2AkLsiyMc+jkCSHMUDQ4B6c7I 1t5w== 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=BVQ3plnJXoPLt9EbHHaAB/OPydKJ4TRhx/A/LhfR+Os=; b=LyKb88Cp327v9x7bijAh+qtbeBBMDl1RKV4aeVj+VdG88Vh4fw5ZN3fM42EZ5Q3bbV kB/bRuOZRoLGfD73a+u7M1jWtSwosEeSQ6WxspmgUyR6cBXVOEF8oFLU3fOCB7068hB0 UdXFz4fRVMMgQE76H0NWpBAFGGlmLweN74gVp4eP+R0RL8v3tCaq/6rYRpOYIuJrZimP YLCJSOlnA+9hFcndRU6lJoaYbVG7OLDsoxYhAUj1dy4Rr5/U0FPwCtJpQEL6+WAf543O cSilQwwClOuWEO1VGz+wzzrlg8NLFHUZAXCIvPwThxC4f58kPc8QGNzCPWRlaa2hW5eu Fybw== X-Gm-Message-State: AJaThX6Tq+ZJ09opu8MB/1TUbE4n7AcE8dApMQPbjGyeBUIKp42cGi20 tMIKHs1rQz+3rtNG+iovxe/av2k= X-Google-Smtp-Source: AGs4zMYn/9il1SJBbruBDO+EpKrdZNMn893aHAXkLDqMCJzrvqSoQuaVNQqPQ6DkCJI6ONX+Y9kHQQ== X-Received: by 10.101.101.151 with SMTP id u23mr3732300pgv.74.1512083294878; Thu, 30 Nov 2017 15:08:14 -0800 (PST) Received: from chimu ([2405:6581:5360:1800:acc6:1cf0:e7a4:d7e8]) by smtp.gmail.com with ESMTPSA id y3sm9188365pff.122.2017.11.30.15.08.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Nov 2017 15:08:14 -0800 (PST) Received: by chimu (sSMTP sendmail emulation); Fri, 01 Dec 2017 08:08:10 +0900 From: Nobuhiro Iwamatsu To: u-boot@lists.denx.de, Joe Hershberger Date: Fri, 1 Dec 2017 08:08:00 +0900 Message-Id: <20171130230800.14576-1-iwamatsu@nigauri.org> X-Mailer: git-send-email 2.15.0 Subject: [U-Boot] [PATCH] net: sh-eth: Fix coding style checked by checkpatch.pl 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" This fixes the chord style checked by checkpatch.pl. Details of change details are as follows: - Fix typo Change from alligned to aligned. - Remove whitespace before ',' - Add spaces preferred around that '|' - Fix missing a blank line after declarations - Remove space after a cast declaration - Fix format of block comments - Add a blank line after function/struct/union/enum declarations Signed-off-by: Nobuhiro Iwamatsu Acked-by: Joe Hershberger --- drivers/net/sh_eth.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c index 970d730e56..5c6278069c 100644 --- a/drivers/net/sh_eth.c +++ b/drivers/net/sh_eth.c @@ -67,7 +67,7 @@ int sh_eth_send(struct eth_device *dev, void *packet, int len) /* packet must be a 4 byte boundary */ if ((int)packet & 3) { - printf(SHETHER_NAME ": %s: packet not 4 byte alligned\n" + printf(SHETHER_NAME ": %s: packet not 4 byte aligned\n" , __func__); ret = -EFAULT; goto err; @@ -222,8 +222,10 @@ static int sh_eth_tx_desc_init(struct sh_eth_dev *eth) cur_tx_desc--; cur_tx_desc->td0 |= TD_TDLE; - /* Point the controller to the tx descriptor list. Must use physical - addresses */ + /* + * Point the controller to the tx descriptor list. Must use physical + * addresses + */ sh_eth_write(eth, ADDR_TO_PHY(port_info->tx_desc_base), TDLAR); #if defined(SH_ETH_TYPE_GETHER) || defined(SH_ETH_TYPE_RZ) sh_eth_write(eth, ADDR_TO_PHY(port_info->tx_desc_base), TDFAR); @@ -237,7 +239,7 @@ err: static int sh_eth_rx_desc_init(struct sh_eth_dev *eth) { - int port = eth->port, i , ret = 0; + int port = eth->port, 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 rx_desc_s *cur_rx_desc; @@ -283,7 +285,7 @@ static int sh_eth_rx_desc_init(struct sh_eth_dev *eth) i < NUM_RX_DESC; cur_rx_desc++, rx_buf += MAX_BUF_SIZE, i++) { cur_rx_desc->rd0 = RD_RACT; cur_rx_desc->rd1 = MAX_BUF_SIZE << 16; - cur_rx_desc->rd2 = (u32) ADDR_TO_PHY(rx_buf); + cur_rx_desc->rd2 = (u32)ADDR_TO_PHY(rx_buf); } /* Mark the end of the descriptors */ @@ -465,11 +467,14 @@ static int sh_eth_config(struct sh_eth_dev *eth, bd_t *bd) /* Check if full duplex mode is supported by the phy */ if (phy->duplex) { printf("Full\n"); - sh_eth_write(eth, val | (ECMR_CHG_DM|ECMR_RE|ECMR_TE|ECMR_DM), + sh_eth_write(eth, + val | (ECMR_CHG_DM | ECMR_RE | ECMR_TE | ECMR_DM), ECMR); } else { printf("Half\n"); - sh_eth_write(eth, val | (ECMR_CHG_DM|ECMR_RE|ECMR_TE), ECMR); + sh_eth_write(eth, + val | (ECMR_CHG_DM | ECMR_RE | ECMR_TE), + ECMR); } return ret; @@ -524,6 +529,7 @@ err: void sh_eth_halt(struct eth_device *dev) { struct sh_eth_dev *eth = dev->priv; + sh_eth_stop(eth); } @@ -532,6 +538,7 @@ int sh_eth_initialize(bd_t *bd) int ret = 0; struct sh_eth_dev *eth = NULL; struct eth_device *dev = NULL; + struct mii_dev *mdiodev; eth = (struct sh_eth_dev *)malloc(sizeof(struct sh_eth_dev)); if (!eth) { @@ -566,16 +573,15 @@ int sh_eth_initialize(bd_t *bd) eth_register(dev); bb_miiphy_buses[0].priv = eth; - int retval; - struct mii_dev *mdiodev = mdio_alloc(); + mdiodev = mdio_alloc(); if (!mdiodev) return -ENOMEM; strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); mdiodev->read = bb_miiphy_read; mdiodev->write = bb_miiphy_write; - retval = mdio_register(mdiodev); - if (retval < 0) + retl = mdio_register(mdiodev); + if (ret < 0) return retval; if (!eth_env_get_enetaddr("ethaddr", dev->enetaddr)) @@ -670,4 +676,5 @@ struct bb_miiphy_bus bb_miiphy_buses[] = { .delay = sh_eth_bb_delay, } }; + int bb_miiphy_buses_num = ARRAY_SIZE(bb_miiphy_buses);