summaryrefslogtreecommitdiff
path: root/include/phy.h
diff options
context:
space:
mode:
authorThirupathaiah Annapureddy <thiruan@linux.microsoft.com>2020-08-17 17:31:08 -0700
committerTom Rini <trini@konsulko.com>2020-09-16 16:54:00 -0400
commit7def4e621b7c65b4a3740a554dcbc807e23b1c19 (patch)
tree9922a33b95bc5880d404015d8b302755740ddcd7 /include/phy.h
parenta8a71c948836688d323fd3efe2afb07865f8b393 (diff)
downloadu-boot-7def4e621b7c65b4a3740a554dcbc807e23b1c19.tar.gz
u-boot-7def4e621b7c65b4a3740a554dcbc807e23b1c19.tar.bz2
u-boot-7def4e621b7c65b4a3740a554dcbc807e23b1c19.zip
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>
Diffstat (limited to 'include/phy.h')
-rw-r--r--include/phy.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/phy.h b/include/phy.h
index 1dbbf65111..cbdb10d6fc 100644
--- a/include/phy.h
+++ b/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;
}