bdf = dm_pci_get_bdf(pdev);
- pci_get_bus(PCI_BUS(bdf), &bus);
-
- if (!bus)
- return -ENODEV;
+ ret = pci_get_bus(PCI_BUS(bdf), &bus);
+ if (ret)
+ return ret;
bdf += PCI_BDF(0, 0, vf_offset);
int sysinfo_get(struct udevice **devp)
{
- return uclass_first_device_err(UCLASS_SYSINFO, devp);
+ int ret = uclass_first_device_err(UCLASS_SYSINFO, devp);
+
+ /*
+ * There is some very dodgy error handling in gazerbeam,
+ * do not return a device on error.
+ */
+ if (ret)
+ *devp = NULL;
+ return ret;
}
int sysinfo_detect(struct udevice *dev)
/**
* uclass_first_device_err() - Get the first device in a uclass
*
- * The device returned is probed if necessary, and ready for use
+ * The device returned is probed if necessary, and ready for use if no error is
+ * returned
*
* @id: Uclass ID to look up
* @devp: Returns pointer to the first device in that uclass, or NULL if none
/**
* uclass_next_device_err() - Get the next device in a uclass
*
- * The device returned is probed if necessary, and ready for use
+ * The device returned is probed if necessary, and ready for use if no error is
+ * returned
*
* @devp: On entry, pointer to device to lookup. On exit, returns pointer
* to the next device in the uclass if no error occurred, or NULL if
/**
* uclass_first_device_check() - Get the first device in a uclass
*
- * The device returned is probed if necessary, and ready for use
+ * The device returned is probed if necessary, and ready for use if no error is
+ * returned
*
* This function is useful to start iterating through a list of devices which
* are functioning correctly and can be probed.
/**
* uclass_next_device_check() - Get the next device in a uclass
*
- * The device returned is probed if necessary, and ready for use
+ * The device returned is probed if necessary, and ready for use if no error is
+ * returned
*
* This function is useful to start iterating through a list of devices which
* are functioning correctly and can be probed.