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>
diff --git a/include/phy.h b/include/phy.h
index 1dbbf65..cbdb10d 100644
--- a/include/phy.h
+++ b/include/phy.h
@@ -205,7 +205,7 @@
{
struct mii_dev *bus = phydev->bus;
- if (!bus || !bus->read) {
+ if (!bus || !bus->write) {
debug("%s: No bus configured\n", __func__);
return -1;
}