Date: Sat, 19 Nov 2016 15:43:23 +0000 (UTC) From: Olivier Houchard <cognet@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308840 - in head/sys/arm/ti: . am335x omap4 Message-ID: <201611191543.uAJFhNAa030363@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cognet Date: Sat Nov 19 15:43:22 2016 New Revision: 308840 URL: https://svnweb.freebsd.org/changeset/base/308840 Log: The only remaining offender that used ti_chip() without checking for compatibility first was the gpio code, so change that, and re-assert that the TI chip is a known chip Modified: head/sys/arm/ti/am335x/am335x_gpio.c head/sys/arm/ti/omap4/omap4_gpio.c head/sys/arm/ti/ti_cpuid.h Modified: head/sys/arm/ti/am335x/am335x_gpio.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_gpio.c Sat Nov 19 15:38:13 2016 (r308839) +++ head/sys/arm/ti/am335x/am335x_gpio.c Sat Nov 19 15:43:22 2016 (r308840) @@ -65,8 +65,6 @@ static struct ofw_compat_data compat_dat 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 @@ am335x_gpio_probe(device_t dev) 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); Modified: head/sys/arm/ti/omap4/omap4_gpio.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_gpio.c Sat Nov 19 15:38:13 2016 (r308839) +++ head/sys/arm/ti/omap4/omap4_gpio.c Sat Nov 19 15:43:22 2016 (r308840) @@ -59,14 +59,14 @@ static struct ofw_compat_data compat_dat static int omap4_gpio_probe(device_t dev) { - if (ti_chip() != CHIP_OMAP_4) - return (ENXIO); if (!ofw_bus_status_okay(dev)) return (ENXIO); 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)"); Modified: head/sys/arm/ti/ti_cpuid.h ============================================================================== --- head/sys/arm/ti/ti_cpuid.h Sat Nov 19 15:38:13 2016 (r308839) +++ head/sys/arm/ti/ti_cpuid.h Sat Nov 19 15:43:22 2016 (r308840) @@ -74,6 +74,7 @@ extern int _ti_chip; static __inline int ti_chip(void) { + KASSERT(_ti_chip != -1, ("Can't determine TI Chip")); return _ti_chip; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611191543.uAJFhNAa030363>