]> asedeno.scripts.mit.edu Git - linux.git/commit
net: ethernet: ti: cpsw: resolve build deps of cpsw drivers
authorGrygorii Strashko <grygorii.strashko@ti.com>
Tue, 19 Nov 2019 22:19:16 +0000 (00:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Nov 2019 19:25:23 +0000 (11:25 -0800)
commit51a9533797b07b44374346fbd36ae0aa4f36ccd3
tree9291d881fa80ebeaa901594249bc5756a5daa0e7
parente85c14370783bf9339a95cab9da0fa54dc770a72
net: ethernet: ti: cpsw: resolve build deps of cpsw drivers

A following patches introduce new CPSW switchdev driver which uses common
code with legacy CPSW driver. This will introduce build dependency between
CPSW switchdev and CPSW legacy drivers related to for_each_slave() and
cpsw_slave_index() - they can be compiled both, but only one of them will
be not functional depending in Kconfig settings due to duffrences in Slave
Ports indexes calculation.

To fix this make for_each_slave() local (it's used now only by legacy CPSW
driver) and convert cpsw_slave_index() to be a function pointer which is
assigned in probe. Driver to probe is defined by DT.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/cpsw_priv.c
drivers/net/ethernet/ti/cpsw_priv.h