summaryrefslogtreecommitdiffstats
path: root/lib/tpm.c
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 /lib/tpm.c
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 'lib/tpm.c')
-rw-r--r--lib/tpm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/tpm.c b/lib/tpm.c
index f428d454fb..88f24060f0 100644
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -242,7 +242,7 @@ static uint32_t tpm_sendrecv_command(const void *command,
response_length = sizeof(response_buffer);
}
- ret = uclass_first_device(UCLASS_TPM, &dev);
+ ret = uclass_first_device_err(UCLASS_TPM, &dev);
if (ret)
return ret;
err = tpm_xfer(dev, command, tpm_command_size(command),
@@ -261,8 +261,8 @@ int tpm_init(void)
int err;
struct udevice *dev;
- err = uclass_first_device(UCLASS_TPM, &dev);
- if (err || !dev)
+ err = uclass_first_device_err(UCLASS_TPM, &dev);
+ if (err)
return err;
return tpm_open(dev);
}
OpenPOWER on IntegriCloud