]> git.gag.com Git - fw/openocd/commit
target/adi_v5_swd: improve error check while updating DP_SELECT
authorAntonio Borneo <borneo.antonio@gmail.com>
Thu, 28 Feb 2019 11:29:49 +0000 (12:29 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Thu, 14 Mar 2019 14:17:48 +0000 (14:17 +0000)
commit0323c9bcbd608f74ab40f63eb62e0cdb4d022401
tree48c66ce9b4f981e7d681faafcc91e69b83799b5d
parent420a692e0fae34a59eb3c33932362812e33f5583
target/adi_v5_swd: improve error check while updating DP_SELECT

Write to register DP_SELECT can fail, but both functions
swd_queue_dp_bankselect() and swd_queue_ap_bankselect() return
void and do not propagate the error.

Change the return type of the two functions to int and check the
returned value.
Invalidate the cached value of DP_SELECT if the write fails.

Change-Id: Iba6ef8b0c2332e7f7efb66337d558fb7a4a0d39c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4980
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/target/adi_v5_swd.c