net: phy: mscc: restore the base page in vsc8514/8584_config_init
authorAntoine Tenart <antoine.tenart@bootlin.com>
Thu, 25 Jun 2020 15:42:09 +0000 (17:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:38 +0000 (08:23 +0200)
commit58af26f071018869447053c467f6f1afbaa02241
treea7c3e1bca8a50fa67d82ad4d08f9aeade8a539fe
parentb0ecffd8339d894d21d9e5b48996ea67f84522c6
net: phy: mscc: restore the base page in vsc8514/8584_config_init

[ Upstream commit 6119dda34e5d0821959e37641b287576826b6378 ]

In the vsc8584_config_init and vsc8514_config_init, the base page is set
to 'GPIO', configuration is done, and the page is never explicitly
restored to the standard page. No bug was triggered as it turns out
helpers called in those config_init functions do modify the base page,
and set it back to standard. But that is dangerous and any modification
to those functions would introduce bugs. This patch fixes this, to
improve maintenance, by restoring the base page to 'standard' once
'GPIO' accesses are completed.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/mscc/mscc_main.c