]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NTB: correct ntb_peer_spad_read for case when callback is not supplied.
authorSteven Wahl <Steve_Wahl@Dell.com>
Thu, 8 Dec 2016 17:02:28 +0000 (17:02 +0000)
committerJon Mason <jdmason@kudzu.us>
Fri, 23 Dec 2016 21:10:50 +0000 (16:10 -0500)
Correct ntb_peer_spad_read for case when callback is not supplied

Signed-off-by: Steve Wahl <Steve.Wahl@dell.com>
Acked-by: Allen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
include/linux/ntb.h

index 6f47562d477bd863377e56b7ca3d2634cb1d05e6..816bd9835bee5b797b0eec542e360a163e8d88da 100644 (file)
@@ -968,6 +968,9 @@ static inline int ntb_peer_spad_addr(struct ntb_dev *ntb, int idx,
  */
 static inline u32 ntb_peer_spad_read(struct ntb_dev *ntb, int idx)
 {
+       if (!ntb->ops->peer_spad_read)
+               return 0;
+
        return ntb->ops->peer_spad_read(ntb, idx);
 }