From owner-svn-src-head@freebsd.org Sun Apr 8 17:06:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08978F9156D; Sun, 8 Apr 2018 17:06:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A855880221; Sun, 8 Apr 2018 17:06:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D84012BA6; Sun, 8 Apr 2018 17:06:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w38H6Uvi014224; Sun, 8 Apr 2018 17:06:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w38H6UPH014223; Sun, 8 Apr 2018 17:06:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804081706.w38H6UPH014223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Apr 2018 17:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332292 - head/sys/dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/spibus X-SVN-Commit-Revision: 332292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Apr 2018 17:06:31 -0000 Author: ian Date: Sun Apr 8 17:06:30 2018 New Revision: 332292 URL: https://svnweb.freebsd.org/changeset/base/332292 Log: Allow hinted attachment on FDT-based systems. Instead of returning ENXIO when the FDT data doesn't enable the device instance, return BUS_PROBE_NOWILDCARD, the same as for non-FDT systems. Modified: head/sys/dev/spibus/spigen.c Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Sun Apr 8 17:03:39 2018 (r332291) +++ head/sys/dev/spibus/spigen.c Sun Apr 8 17:06:30 2018 (r332292) @@ -79,16 +79,19 @@ spigen_probe(device_t dev) { int rv; -#ifdef FDT - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "freebsd,spigen")) - return (ENXIO); - rv = BUS_PROBE_DEFAULT; -#else + /* + * By default we only bid to attach if specifically added by our parent + * (usually via hint.spigen.#.at=busname). On FDT systems we bid as the + * default driver based on being configured in the FDT data. + */ rv = BUS_PROBE_NOWILDCARD; + +#ifdef FDT + if (ofw_bus_status_okay(dev) && + ofw_bus_is_compatible(dev, "freebsd,spigen")) + rv = BUS_PROBE_DEFAULT; #endif + device_set_desc(dev, "SPI Generic IO"); return (rv);