diff --git a/sys/dev/flash/mx25l.c b/sys/dev/flash/mx25l.c index c4dad4b2877..c43b751fb1f 100644 --- a/sys/dev/flash/mx25l.c +++ b/sys/dev/flash/mx25l.c @@ -26,6 +26,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -40,6 +42,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + #include #include "spibus_if.h" @@ -360,7 +368,15 @@ mx25l_read(device_t dev, off_t offset, caddr_t data, off_t count) static int mx25l_probe(device_t dev) { + +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "st,m25p")) + return (ENXIO); +#endif device_set_desc(dev, "M25Pxx Flash Family"); + return (0); }