On 6/24/19 5:20 AM, Andrew Lunn wrote: > On Mon, Jun 24, 2019 at 12:35:03AM +0200, Marek Vasut wrote: >> 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. > > Hi Marek > > Rather than change just one instance, it would be better to change > them all. And then remove dev_ops->get_port_addr().
So that actually doesn't work. The rest of the calls are in common code (ksz_common.h) and I plan to add the KSZ8795, which has different spacing between the ports, so those have to stay. Although, depending on how things look, I will do more regmap cleanups, the driver needs it. Since I have the KSZ9477 devkit, that also makes it much easier to test the changes. I think inlining those custom accessors would be high on the list, because they are just a mess. But that's for another series. -- Best regards, Marek Vasut