include: phy: fix NULL pointer check in phy_write()

phy_write() uses bus->write() instead of bus->read(). This means NULL
pointer pre-check needs to happen on bus->write instead of bus->read.

Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
Thirupathaiah Annapureddy 2020-08-17 17:31:08 -07:00 committed by Tom Rini
parent a8a71c9488
commit 7def4e621b

View File

@ -205,7 +205,7 @@ static inline int phy_write(struct phy_device *phydev, int devad, int regnum,
{
struct mii_dev *bus = phydev->bus;
if (!bus || !bus->read) {
if (!bus || !bus->write) {
debug("%s: No bus configured\n", __func__);
return -1;
}