Index: arm/ti/am335x/am335x_gpio.c =================================================================== --- arm/ti/am335x/am335x_gpio.c (revision 308830) +++ arm/ti/am335x/am335x_gpio.c (working copy) @@ -65,8 +65,6 @@ static int am335x_gpio_probe(device_t dev) { - if (ti_chip() != CHIP_AM335X) - return (ENXIO); if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -74,6 +72,9 @@ if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); + if (ti_chip() != CHIP_AM335X) + return (ENXIO); + device_set_desc(dev, "TI AM335x General Purpose I/O (GPIO)"); return (0); Index: arm/ti/omap4/omap4_gpio.c =================================================================== --- arm/ti/omap4/omap4_gpio.c (revision 308830) +++ arm/ti/omap4/omap4_gpio.c (working copy) @@ -59,8 +59,6 @@ static int omap4_gpio_probe(device_t dev) { - if (ti_chip() != CHIP_OMAP_4) - return (ENXIO); if (!ofw_bus_status_okay(dev)) return (ENXIO); @@ -67,6 +65,8 @@ if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); + if (ti_chip() != CHIP_OMAP_4) + return (ENXIO); device_set_desc(dev, "TI OMAP4 General Purpose I/O (GPIO)"); Index: arm/ti/ti_cpuid.h =================================================================== --- arm/ti/ti_cpuid.h (revision 308837) +++ arm/ti/ti_cpuid.h (working copy) @@ -74,6 +74,7 @@ static __inline int ti_chip(void) { + KASSERT(_ti_chip != -1, ("Can't determine TI Chip")); return _ti_chip; }