Browse Source

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>
Thirupathaiah Annapureddy 3 years ago
parent
commit
7def4e621b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      include/phy.h

+ 1 - 1
include/phy.h

@@ -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;
 	}