summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/date.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmd/date.c b/cmd/date.c
index e377cfe165..149ca426e8 100644
--- a/cmd/date.c
+++ b/cmd/date.c
@@ -41,10 +41,13 @@ static int do_date(struct cmd_tbl *cmdtp, int flag, int argc,
#ifdef CONFIG_DM_RTC
struct udevice *dev;
- rcode = uclass_get_device(UCLASS_RTC, 0, &dev);
+ rcode = uclass_get_device_by_seq(UCLASS_RTC, 0, &dev);
if (rcode) {
- printf("Cannot find RTC: err=%d\n", rcode);
- return CMD_RET_FAILURE;
+ rcode = uclass_get_device(UCLASS_RTC, 0, &dev);
+ if (rcode) {
+ printf("Cannot find RTC: err=%d\n", rcode);
+ return CMD_RET_FAILURE;
+ }
}
#elif defined(CONFIG_SYS_I2C_LEGACY)
old_bus = i2c_get_bus_num();