staging: vt6655: Use loop in vt6655_mac_read_ether_addr

Use loop in vt6655_mac_read_ether_addr to avoid multiple
similar statements.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/f233c8a007d75a8adcc99a07c582b75bdc1985db.1657134099.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Philipp Hortmann 2022-07-06 21:19:06 +02:00 committed by Greg Kroah-Hartman
parent 385b35ab80
commit 2a1f94e455

View File

@ -200,12 +200,8 @@ static void vt6655_mac_write_bssid_addr(void __iomem *iobase, const u8 *mac_addr
static void vt6655_mac_read_ether_addr(void __iomem *iobase, u8 *mac_addr)
{
iowrite8(1, iobase + MAC_REG_PAGE1SEL);
mac_addr[0] = ioread8(iobase + MAC_REG_PAR0);
mac_addr[1] = ioread8(iobase + MAC_REG_PAR0 + 1);
mac_addr[2] = ioread8(iobase + MAC_REG_PAR0 + 2);
mac_addr[3] = ioread8(iobase + MAC_REG_PAR0 + 3);
mac_addr[4] = ioread8(iobase + MAC_REG_PAR0 + 4);
mac_addr[5] = ioread8(iobase + MAC_REG_PAR0 + 5);
for (int i = 0; i < 6; i++)
mac_addr[i] = ioread8(iobase + MAC_REG_PAR0 + i);
iowrite8(0, iobase + MAC_REG_PAGE1SEL);
}