net: dsa: microchip: Factor out register access opcode generation
authorMarek Vasut <marex@denx.de>
Tue, 25 Jun 2019 23:43:44 +0000 (01:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Jun 2019 18:00:31 +0000 (11:00 -0700)
commitff509dab43763899bff796c8ae5e57261ff18edc
tree94df87913db41060bfa95f39c0a43c113c09565e
parent5ce9676e8b42fbe8030972e5631990545b34e2f3
net: dsa: microchip: Factor out register access opcode generation

Factor out the code which sends out the register read/write opcodes
to the switch, since the code differs in single bit between read and
write.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Tristram Ha <Tristram.Ha@microchip.com>
Cc: Woojung Huh <Woojung.Huh@microchip.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz9477_spi.c