]> git.dujemihanovic.xyz Git - u-boot.git/commit
net: sun8i_emac: Simplify mdio_read/mdio_write functions
authorAndre Przywara <andre.przywara@arm.com>
Mon, 6 Jul 2020 00:40:34 +0000 (01:40 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Wed, 21 Oct 2020 18:12:51 +0000 (23:42 +0530)
commitf20f9465dbbee7df134ea2b1a8466799234afdf1
treec8476ba02126f1cf539e3ba861b6d376a36647c3
parentc35380c756a607f857b57aaaf93c53648ca10e9e
net: sun8i_emac: Simplify mdio_read/mdio_write functions

When preparing the register value for the MDIO command register, we
start with a zeroed register, so there is no need to mask off certain
bits before setting them.
Simplify the sequence, and rename the variable to a more matching
mii_cmd on the way.

Also the open-coded time-out routine can be replaced with a much safer
and easier-to-read call to wait_for_bit_le32().

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Tested-by: Amit Singh Tomar <amittomer25@gmail.com> # Pine64+
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/net/sun8i_emac.c