From: Thirupathaiah Annapureddy Date: Tue, 18 Aug 2020 00:31:08 +0000 (-0700) Subject: include: phy: fix NULL pointer check in phy_write() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=7def4e621b7c65b4a3740a554dcbc807e23b1c19;p=u-boot.git 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 Reviewed-by: Michal Simek --- 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; }