summaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 38b0670187..d7b10afbc9 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -251,7 +251,7 @@ struct phy_driver {
struct driver_d drv;
};
-#define to_phy_driver(d) container_of(d, struct phy_driver, drv)
+#define to_phy_driver(d) ((d) ? container_of(d, struct phy_driver, drv) : NULL)
#define PHY_ANY_ID "MATCH ANY PHY"
#define PHY_ANY_UID 0xffffffff