From fd420f84ddd8e4ac3600a482c145dded5974ba6e Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 13 Feb 2014 16:50:08 +0000 Subject: [PATCH] Honor the disabled status by only grabbing resources and returning when running under FDT. --- sys/arm/at91/at91_spi.c | 9 +++++++++ sys/arm/at91/at91_twi.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/sys/arm/at91/at91_spi.c b/sys/arm/at91/at91_spi.c index 02e25a1e15c..cdbc7b8e298 100644 --- a/sys/arm/at91/at91_spi.c +++ b/sys/arm/at91/at91_spi.c @@ -131,6 +131,15 @@ at91_spi_attach(device_t dev) if (err) goto out; +#ifdef FDT + /* + * Disable devices need to hold their resources, so return now and not attach + * the spibus, setup interrupt handlers, etc. + */ + if (!ofw_bus_status_okay(dev)) + return 0; +#endif + /* * Set up the hardware. */ diff --git a/sys/arm/at91/at91_twi.c b/sys/arm/at91/at91_twi.c index 559200cf682..f9a7294e404 100644 --- a/sys/arm/at91/at91_twi.c +++ b/sys/arm/at91/at91_twi.c @@ -134,6 +134,15 @@ at91_twi_attach(device_t dev) AT91_TWI_LOCK_INIT(sc); +#ifdef FDT + /* + * Disable devices need to hold their resources, so return now and not attach + * the iicbus, setup interrupt handlers, etc. + */ + if (!ofw_bus_status_okay(dev)) + return 0; +#endif + /* * Activate the interrupt */