From: Steven Wahl Date: Thu, 8 Dec 2016 17:02:28 +0000 (+0000) Subject: NTB: correct ntb_peer_spad_read for case when callback is not supplied. X-Git-Tag: MMI-PSA29.97-13-9~6471^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5c43c52d5fb6163120ae5d9a281c3b757ca6119c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git NTB: correct ntb_peer_spad_read for case when callback is not supplied. Correct ntb_peer_spad_read for case when callback is not supplied Signed-off-by: Steve Wahl Acked-by: Allen Hubbe Signed-off-by: Jon Mason --- diff --git a/include/linux/ntb.h b/include/linux/ntb.h index 6f47562d477b..816bd9835bee 100644 --- a/include/linux/ntb.h +++ b/include/linux/ntb.h @@ -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); }