power: io-domain: initialize all io-domain

There maybe more than one io-domain.

Change-Id: I786544547b7c5da034e4d9685d60144c22266c3b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
Joseph Chen 2019-07-25 15:11:49 +08:00 committed by Jianhong Chen
parent 6a4b5e01bf
commit fe404743f8
2 changed files with 13 additions and 5 deletions

View File

@ -7,14 +7,22 @@
#include <console.h>
#include <io-domain.h>
void io_domain_init(void)
int io_domain_init(void)
{
int ret;
struct udevice *dev;
struct uclass *uc;
int ret;
ret = uclass_get_device(UCLASS_IO_DOMAIN, 0, &dev);
ret = uclass_get(UCLASS_IO_DOMAIN, &uc);
if (ret)
printf("Can't find UCLASS_IO_DOMAIN driver %d\n", ret);
return ret;
for (uclass_first_device(UCLASS_IO_DOMAIN, &dev);
dev;
uclass_next_device(&dev))
;
return 0;
}
UCLASS_DRIVER(io_domain) = {

View File

@ -11,6 +11,6 @@
/**
* io_domain_init() - init io-domain driver
*/
void io_domain_init(void);
int io_domain_init(void);
#endif /* _IO_DOMAIN_H_ */