diff options
author | Ian Lepore <ian@FreeBSD.org> | 2018-04-07 18:25:07 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2018-04-07 18:25:07 +0000 |
commit | c1ec6ac5105faafc53e3c69df01573f746191f59 (patch) | |
tree | 9e3005588692da29e494c8cca2fe91221fa36d50 /sys/dev/spibus | |
parent | 392bffb9b156261c866e26f094558335135c979a (diff) | |
download | src-c1ec6ac5105faafc53e3c69df01573f746191f59.tar.gz src-c1ec6ac5105faafc53e3c69df01573f746191f59.zip |
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.
Notes
Notes:
svn path=/head/; revision=332195
Diffstat (limited to 'sys/dev/spibus')
-rw-r--r-- | sys/dev/spibus/spibus.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/spibus/spibus.c b/sys/dev/spibus/spibus.c index d205e3d865ae..ec3739b6939f 100644 --- a/sys/dev/spibus/spibus.c +++ b/sys/dev/spibus/spibus.c @@ -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); } |