From: Marek Vasut Date: Tue, 25 Jun 2019 23:43:43 +0000 (+0200) Subject: net: dsa: microchip: Use PORT_CTRL_ADDR() instead of indirect function call X-Git-Tag: v5.3-rc1~140^2~130^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5ce9676e8b42fbe8030972e5631990545b34e2f3;p=users%2Fjedix%2Flinux-maple.git 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 Cc: Andrew Lunn Cc: Florian Fainelli Cc: Tristram Ha Cc: Woojung Huh Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index e8b96566abd9..7d209fd9f26f 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -83,7 +83,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)