From owner-svn-src-all@freebsd.org Sat Apr 7 18:25:08 2018 Return-Path: Delivered-To: svn-src-all@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 EE5C6F9CD10; Sat, 7 Apr 2018 18:25:07 +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 9AED67BD18; Sat, 7 Apr 2018 18:25:07 +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 95D0F24675; Sat, 7 Apr 2018 18:25:07 +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 w37IP7g2025028; Sat, 7 Apr 2018 18:25:07 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w37IP7ri025027; Sat, 7 Apr 2018 18:25:07 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201804071825.w37IP7ri025027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Apr 2018 18:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332195 - 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: 332195 X-SVN-Commit-Repository: base 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.25 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: Sat, 07 Apr 2018 18:25:08 -0000 Author: ian Date: Sat Apr 7 18:25:07 2018 New Revision: 332195 URL: https://svnweb.freebsd.org/changeset/base/332195 Log: A couple minor improvements to spibus.c... - Change the description string to "SPI bus" (was "spibus bus"). - This is the default driver for a SPI bus, not a generic implementation, so return the probe value that indicates such. - Use device_delete_children() at detach time, instead of a local loop to enumerate the children and detach each one individually. Modified: head/sys/dev/spibus/spibus.c Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Sat Apr 7 18:09:31 2018 (r332194) +++ head/sys/dev/spibus/spibus.c Sat Apr 7 18:25:07 2018 (r332195) @@ -49,8 +49,9 @@ __FBSDID("$FreeBSD$"); static int spibus_probe(device_t dev) { - device_set_desc(dev, "spibus bus"); - return (BUS_PROBE_GENERIC); + + device_set_desc(dev, "SPI bus"); + return (BUS_PROBE_DEFAULT); } static int @@ -70,16 +71,11 @@ spibus_attach(device_t dev) static int spibus_detach(device_t dev) { - int err, ndevs, i; - device_t *devlist; + int err; if ((err = bus_generic_detach(dev)) != 0) return (err); - if ((err = device_get_children(dev, &devlist, &ndevs)) != 0) - return (err); - for (i = 0; i < ndevs; i++) - device_delete_child(dev, devlist[i]); - free(devlist, M_TEMP); + device_delete_children(dev); return (0); }