mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 23:28:58 +00:00
MFp4: when passing the transfer up the foodchain, make sure we go up
the food chain. devi == NULL is the error condition. Treat it as such.
This commit is contained in:
parent
0f1c5aca64
commit
86663fabdd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=163527
|
@ -136,8 +136,10 @@ spibus_add_child(device_t dev, int order, const char *name, int unit)
|
|||
if (child == NULL)
|
||||
return (child);
|
||||
devi = malloc(sizeof(struct spibus_ivar), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (devi != NULL)
|
||||
if (devi == NULL) {
|
||||
device_delete_child(dev, child);
|
||||
return (0);
|
||||
}
|
||||
device_set_ivars(child, devi);
|
||||
return (child);
|
||||
}
|
||||
|
@ -156,7 +158,7 @@ spibus_hinted_child(device_t bus, const char *dname, int dunit)
|
|||
static int
|
||||
spibus_transfer_impl(device_t dev, device_t child, struct spi_command *cmd)
|
||||
{
|
||||
return (SPIBUS_TRANSFER(dev, child, cmd));
|
||||
return (SPIBUS_TRANSFER(device_get_parent(dev), child, cmd));
|
||||
}
|
||||
|
||||
static device_method_t spibus_methods[] = {
|
||||
|
|
Loading…
Reference in a new issue