aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-06-07 10:28:38 -0600
committerTom Rini <trini@konsulko.com>2017-06-12 08:38:06 -0400
commit1a596c44c0967b3191ee278f988d14d6082249e1 (patch)
tree1f5910e49915ee939de3e01145af83cfd0f7cbd3 /test
parent502589777416aaee32e4ba1682c6eb3aa3a88e1c (diff)
downloadu-boot-1a596c44c0967b3191ee278f988d14d6082249e1.zip
u-boot-1a596c44c0967b3191ee278f988d14d6082249e1.tar.gz
u-boot-1a596c44c0967b3191ee278f988d14d6082249e1.tar.bz2
test: pwm: Add a check that dev is not NULL
We know that uclass_get_device() does not return NULL for dev when it succeeds but coverity does not. Add an extra check to hopefully keep it happy. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 161690) Fixes: 43b4156 (dm: sandbox: pwm: Add a basic pwm test)
Diffstat (limited to 'test')
-rw-r--r--test/dm/pwm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/dm/pwm.c b/test/dm/pwm.c
index f1e38c7..6b2dedf 100644
--- a/test/dm/pwm.c
+++ b/test/dm/pwm.c
@@ -18,6 +18,7 @@ static int dm_test_pwm_base(struct unit_test_state *uts)
struct udevice *dev;
ut_assertok(uclass_get_device(UCLASS_PWM, 0, &dev));
+ ut_assertnonnull(dev);
ut_assertok(pwm_set_config(dev, 0, 100, 50));
ut_assertok(pwm_set_enable(dev, 0, true));
ut_assertok(pwm_set_enable(dev, 1, true));