]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: add reference to ksz_device inside the ksz_port
authorArun Ramadoss <arun.ramadoss@microchip.com>
Fri, 2 Sep 2022 10:32:08 +0000 (16:02 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Sep 2022 12:06:39 +0000 (13:06 +0100)
commit8d2db482c0841c36d013f283082112d4c9e5f59e
tree247fd1a36ff1c23089e2773800b8428d71cf9470
parentc9c02553ef558a3cd5032998bdc7c39d756150bd
net: dsa: microchip: add reference to ksz_device inside the ksz_port

struct ksz_port doesn't have reference to ksz_device as of now. In order
to find out from which port interrupt has triggered, we need to pass the
struct ksz_port as a host data. When the interrupt is triggered, we can
get the port from which interrupt triggered, but to identify it is phy
interrupt we have to read status register. The regmap structure for
accessing the device register is present in the ksz_device struct. To
access the ksz_device from the ksz_port, the reference is added to it
with port number as well.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h