From owner-svn-src-all@FreeBSD.ORG Thu Feb 13 16:50:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A82631E; Thu, 13 Feb 2014 16:50:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15FC5185C; Thu, 13 Feb 2014 16:50:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1DGo8nX055765; Thu, 13 Feb 2014 16:50:08 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1DGo8xg055763; Thu, 13 Feb 2014 16:50:08 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402131650.s1DGo8xg055763@svn.freebsd.org> From: Warner Losh Date: Thu, 13 Feb 2014 16:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261841 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Feb 2014 16:50:09 -0000 Author: imp Date: Thu Feb 13 16:50:08 2014 New Revision: 261841 URL: http://svnweb.freebsd.org/changeset/base/261841 Log: Honor the disabled status by only grabbing resources and returning when running under FDT. Modified: head/sys/arm/at91/at91_spi.c head/sys/arm/at91/at91_twi.c Modified: head/sys/arm/at91/at91_spi.c ============================================================================== --- head/sys/arm/at91/at91_spi.c Thu Feb 13 16:38:00 2014 (r261840) +++ head/sys/arm/at91/at91_spi.c Thu Feb 13 16:50:08 2014 (r261841) @@ -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. */ Modified: head/sys/arm/at91/at91_twi.c ============================================================================== --- head/sys/arm/at91/at91_twi.c Thu Feb 13 16:38:00 2014 (r261840) +++ head/sys/arm/at91/at91_twi.c Thu Feb 13 16:50:08 2014 (r261841) @@ -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 */