[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181221015841.6992-6-marex@denx.de>
Date: Fri, 21 Dec 2018 02:58:36 +0100
From: Marek Vasut <marex@...x.de>
To: netdev@...r.kernel.org
Cc: f.fainelli@...il.com, andrew@...n.ch, Marek Vasut <marex@...x.de>,
Tristram Ha <Tristram.Ha@...rochip.com>,
Woojung Huh <Woojung.Huh@...rochip.com>
Subject: [RFT][PATCH V2 05/10] net: dsa: microchip: Use PORT_CTRL_ADDR() instead of indirect function call
The indirect function call to dev->dev_ops->get_port_addr() is expensive
especially if called for every single register access, and only returns
the value of PORT_CTRL_ADDR() macro. Use PORT_CTRL_ADDR() macro directly
instead.
Signed-off-by: Marek Vasut <marex@...x.de>
Cc: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>
Cc: Tristram Ha <Tristram.Ha@...rochip.com>
Cc: Woojung Huh <Woojung.Huh@...rochip.com>
---
V2: New patch
---
drivers/net/dsa/microchip/ksz9477.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c
index 017d26c03b42..5e720a9e3659 100644
--- a/drivers/net/dsa/microchip/ksz9477.c
+++ b/drivers/net/dsa/microchip/ksz9477.c
@@ -81,7 +81,7 @@ static void ksz_port_cfg(struct ksz_device *dev, int port, int offset, u8 bits,
u32 addr;
u8 data;
- addr = dev->dev_ops->get_port_addr(port, offset);
+ addr = PORT_CTRL_ADDR(port, offset);
ksz_read8(dev, addr, &data);
if (set)
--
2.19.2
Powered by blists - more mailing lists