aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/bhnd/cores/chipc/chipc_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/bhnd/cores/chipc/chipc_spi.c')
-rw-r--r--sys/dev/bhnd/cores/chipc/chipc_spi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/bhnd/cores/chipc/chipc_spi.c b/sys/dev/bhnd/cores/chipc/chipc_spi.c
index 75e4b5cb7bc4..290933e5ef25 100644
--- a/sys/dev/bhnd/cores/chipc/chipc_spi.c
+++ b/sys/dev/bhnd/cores/chipc/chipc_spi.c
@@ -107,7 +107,8 @@ chipc_spi_attach(device_t dev)
* XXX: This should be replaced with a DEVICE_IDENTIFY implementation
* in chipc-specific subclasses of the mx25l and at45d drivers.
*/
- if ((spibus = device_add_child(dev, "spibus", -1)) == NULL) {
+ if ((spibus = device_add_child(dev, "spibus",
+ DEVICE_UNIT_ANY)) == NULL) {
device_printf(dev, "failed to add spibus\n");
error = ENXIO;
goto failed;
@@ -115,14 +116,14 @@ chipc_spi_attach(device_t dev)
/* Let spibus perform full attach before we try to call
* BUS_ADD_CHILD() */
- if ((error = bus_generic_attach(dev)))
- goto failed;
+ bus_attach_children(dev);
/* Determine flash type and add the flash child */
ccaps = BHND_CHIPC_GET_CAPS(device_get_parent(dev));
flash_name = chipc_sflash_device_name(ccaps->flash_type);
if (flash_name != NULL) {
- flash_dev = BUS_ADD_CHILD(spibus, 0, flash_name, -1);
+ flash_dev = BUS_ADD_CHILD(spibus, 0, flash_name,
+ DEVICE_UNIT_ANY);
if (flash_dev == NULL) {
device_printf(dev, "failed to add %s\n", flash_name);
error = ENXIO;