summaryrefslogtreecommitdiffstats
path: root/drivers/timer
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-02-11 13:23:26 -0700
committerSimon Glass <sjg@chromium.org>2016-03-14 15:34:50 -0600
commit3f603cbbb8e175e545d6037a783e1ef82bab30f9 (patch)
treec3122b2be426be9bcfd3285bda86cb175fb9aaeb /drivers/timer
parentb06750501f5c0eef7fef094f13d2f2e313c60b79 (diff)
downloadblackbird-obmc-uboot-3f603cbbb8e175e545d6037a783e1ef82bab30f9.tar.gz
blackbird-obmc-uboot-3f603cbbb8e175e545d6037a783e1ef82bab30f9.zip
dm: Use uclass_first_device_err() where it is useful
Use this new function in places where it simplifies the code. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/timer')
-rw-r--r--drivers/timer/timer-uclass.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c
index 382c0f2bd1..f8ddf93cf8 100644
--- a/drivers/timer/timer-uclass.c
+++ b/drivers/timer/timer-uclass.c
@@ -82,11 +82,9 @@ int notrace dm_timer_init(void)
node = fdtdec_get_chosen_node(blob, "tick-timer");
if (node < 0) {
/* No chosen timer, trying first available timer */
- ret = uclass_first_device(UCLASS_TIMER, &dev);
+ ret = uclass_first_device_err(UCLASS_TIMER, &dev);
if (ret)
return ret;
- if (!dev)
- return -ENODEV;
} else {
if (uclass_get_device_by_of_offset(UCLASS_TIMER, node, &dev)) {
/*
OpenPOWER on IntegriCloud