return ops->get_info(dev, info);
}
+int cpu_get_count(struct udevice *dev)
+{
+ struct cpu_ops *ops = cpu_get_ops(dev);
+
+ if (!ops->get_count)
+ return -ENOSYS;
+
+ return ops->get_count(dev);
+}
+
U_BOOT_DRIVER(cpu_bus) = {
.name = "cpu_bus",
.id = UCLASS_SIMPLE_BUS,
* @return 0 if OK, -ve on error
*/
int (*get_info)(struct udevice *dev, struct cpu_info *info);
+
+ /**
+ * get_count() - Get number of CPUs
+ *
+ * @dev: Device to check (UCLASS_CPU)
+ * @return CPU count if OK, -ve on error
+ */
+ int (*get_count)(struct udevice *dev);
};
#define cpu_get_ops(dev) ((struct cpu_ops *)(dev)->driver->ops)
*/
int cpu_get_info(struct udevice *dev, struct cpu_info *info);
+/**
+ * cpu_get_count() - Get number of CPUs
+ *
+ * @dev: Device to check (UCLASS_CPU)
+ * @return CPU count if OK, -ve on error
+ */
+int cpu_get_count(struct udevice *dev);
+
#endif