netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, andrew@lunn.ch,
	vivien.didelot@savoirfairelinux.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH net-next 02/12] net: dsa: b53: Make b53_enable_cpu_port() take a port argument
Date: Mon, 18 Sep 2017 14:41:18 -0700	[thread overview]
Message-ID: <20170918214128.27896-3-f.fainelli@gmail.com> (raw)
In-Reply-To: <20170918214128.27896-1-f.fainelli@gmail.com>

In preparation for future changes allowing the configuring of multiple
CPU ports, make b53_enable_cpu_port() take a port argument.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/b53/b53_common.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 274f3679f33d..d8bc54cfcfbe 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -538,19 +538,18 @@ static void b53_disable_port(struct dsa_switch *ds, int port,
 	b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), reg);
 }
 
-static void b53_enable_cpu_port(struct b53_device *dev)
+static void b53_enable_cpu_port(struct b53_device *dev, int port)
 {
-	unsigned int cpu_port = dev->cpu_port;
 	u8 port_ctrl;
 
 	/* BCM5325 CPU port is at 8 */
-	if ((is5325(dev) || is5365(dev)) && cpu_port == B53_CPU_PORT_25)
-		cpu_port = B53_CPU_PORT;
+	if ((is5325(dev) || is5365(dev)) && port == B53_CPU_PORT_25)
+		port = B53_CPU_PORT;
 
 	port_ctrl = PORT_CTRL_RX_BCST_EN |
 		    PORT_CTRL_RX_MCST_EN |
 		    PORT_CTRL_RX_UCST_EN;
-	b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(cpu_port), port_ctrl);
+	b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), port_ctrl);
 }
 
 static void b53_enable_mib(struct b53_device *dev)
@@ -820,7 +819,7 @@ static int b53_setup(struct dsa_switch *ds)
 		if (BIT(port) & ds->enabled_port_mask)
 			b53_enable_port(ds, port, NULL);
 		else if (dsa_is_cpu_port(ds, port))
-			b53_enable_cpu_port(dev);
+			b53_enable_cpu_port(dev, port);
 		else
 			b53_disable_port(ds, port, NULL);
 	}
-- 
2.9.3

  parent reply	other threads:[~2017-09-18 21:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-18 21:41 [PATCH net-next 00/12] net: dsa: b53/bcm_sf2 cleanups Florian Fainelli
2017-09-18 21:41 ` [PATCH net-next 01/12] net: dsa: b53: Remove is_cpu_port() Florian Fainelli
2017-09-18 21:44   ` Vivien Didelot
2017-09-18 21:41 ` Florian Fainelli [this message]
2017-09-18 21:46   ` [PATCH net-next 02/12] net: dsa: b53: Make b53_enable_cpu_port() take a port argument Vivien Didelot
2017-09-18 21:41 ` [PATCH net-next 03/12] net: dsa: b53: Defer port enabling to calling port_enable Florian Fainelli
2017-09-18 21:53   ` Vivien Didelot
2017-09-18 21:41 ` [PATCH net-next 04/12] net: dsa: bcm_sf2: " Florian Fainelli
2017-09-18 21:54   ` Vivien Didelot
2017-09-18 21:41 ` [PATCH net-next 05/12] net: dsa: b53: Use a macro to define I/O operations Florian Fainelli
2017-09-18 22:12   ` Vivien Didelot
2017-09-19 12:53   ` David Laight
2017-09-19 14:19     ` Vivien Didelot
2017-09-19 14:29       ` Florian Fainelli
2017-09-19 16:14         ` David Laight
2017-09-18 21:41 ` [PATCH net-next 06/12] net: dsa: b53: Move Broadcom header setup to b53 Florian Fainelli
2017-09-18 22:14   ` Vivien Didelot
2017-09-18 21:41 ` [PATCH net-next 07/12] net: dsa: b53: Define EEE register page Florian Fainelli
2017-09-18 21:41 ` [PATCH net-next 08/12] net: dsa: b53: Move EEE functions to b53 Florian Fainelli
2017-09-18 22:27   ` Vivien Didelot
2017-09-18 22:33     ` Florian Fainelli
2017-09-18 21:41 ` [PATCH net-next 09/12] net: dsa: b53: Wire-up EEE Florian Fainelli
2017-09-18 22:29   ` Vivien Didelot
2017-09-18 22:34     ` Florian Fainelli
2017-09-18 21:41 ` [PATCH net-next 10/12] net: dsa: b53: Export b53_imp_vlan_setup() Florian Fainelli
2017-09-18 21:41 ` [PATCH net-next 11/12] net: dsa: bcm_sf2: Use SF2_NUM_EGRESS_QUEUES for CFP Florian Fainelli
2017-09-18 21:41 ` [PATCH net-next 12/12] net: dsa: bcm_sf2: Utilize b53_{enable,disable}_port Florian Fainelli
2017-09-18 21:46 ` [PATCH net-next 00/12] net: dsa: b53/bcm_sf2 cleanups Florian Fainelli
2017-09-18 23:24   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170918214128.27896-3-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).