diff options
author | Tom Rini <trini@konsulko.com> | 2015-07-15 14:41:20 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-07-15 14:41:20 (GMT) |
commit | 605e15db2b54302364a2528d3c6604fbc57be846 (patch) | |
tree | 1a1e344964bff1719939183124d66a71e7ca7731 /drivers/cpu/cpu-uclass.c | |
parent | 4905dfc65d9a17083727865302d2cf633c15c911 (diff) | |
parent | f110da9984c0aa0aba9e1c4178b67b7abecf7e8d (diff) | |
download | u-boot-605e15db2b54302364a2528d3c6604fbc57be846.tar.xz |
Merge git://git.denx.de/u-boot-x86
Diffstat (limited to 'drivers/cpu/cpu-uclass.c')
-rw-r--r-- | drivers/cpu/cpu-uclass.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/cpu/cpu-uclass.c b/drivers/cpu/cpu-uclass.c index ab18ee2..7660f99 100644 --- a/drivers/cpu/cpu-uclass.c +++ b/drivers/cpu/cpu-uclass.c @@ -8,9 +8,12 @@ #include <common.h> #include <cpu.h> #include <dm.h> +#include <errno.h> #include <dm/lists.h> #include <dm/root.h> +DECLARE_GLOBAL_DATA_PTR; + int cpu_get_desc(struct udevice *dev, char *buf, int size) { struct cpu_ops *ops = cpu_get_ops(dev); @@ -25,12 +28,22 @@ int cpu_get_info(struct udevice *dev, struct cpu_info *info) { struct cpu_ops *ops = cpu_get_ops(dev); - if (!ops->get_desc) + if (!ops->get_info) return -ENOSYS; 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, |