mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
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)
This commit is contained in:
parent
5025897774
commit
1a596c44c0
1 changed files with 1 additions and 0 deletions
|
@ -18,6 +18,7 @@ static int dm_test_pwm_base(struct unit_test_state *uts)
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
|
|
||||||
ut_assertok(uclass_get_device(UCLASS_PWM, 0, &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_config(dev, 0, 100, 50));
|
||||||
ut_assertok(pwm_set_enable(dev, 0, true));
|
ut_assertok(pwm_set_enable(dev, 0, true));
|
||||||
ut_assertok(pwm_set_enable(dev, 1, true));
|
ut_assertok(pwm_set_enable(dev, 1, true));
|
||||||
|
|
Loading…
Add table
Reference in a new issue