diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp.c b/XilinxProcessorIPLib/drivers/dp/src/xdp.c index 15adf80f..83a7f89d 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp.c +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp.c @@ -804,9 +804,8 @@ u32 XDp_TxIicRead(XDp *InstancePtr, u8 IicAddress, u16 Offset, NumBytesLeftInSeg = 256 - Offset; /* Set the segment pointer to 0. */ - Status = XDp_TxIicWrite(InstancePtr, XDP_SEGPTR_ADDR, 1, &SegPtr); - if (Status != XST_SUCCESS) { - return Status; + if (SegPtr != 0) { + XDp_TxIicWrite(InstancePtr, XDP_SEGPTR_ADDR, 1, &SegPtr); } /* Send I2C read message. Multiple transactions are required if the @@ -848,11 +847,8 @@ u32 XDp_TxIicRead(XDp *InstancePtr, u8 IicAddress, u16 Offset, Offset %= 256; SegPtr++; - Status = XDp_TxIicWrite(InstancePtr, - XDP_SEGPTR_ADDR, 1, &SegPtr); - if (Status != XST_SUCCESS) { - return Status; - } + XDp_TxIicWrite(InstancePtr, XDP_SEGPTR_ADDR, + 1, &SegPtr); } } /* Last I2C read. */ @@ -862,8 +858,10 @@ u32 XDp_TxIicRead(XDp *InstancePtr, u8 IicAddress, u16 Offset, } /* Reset the segment pointer to 0. */ - SegPtr = 0; - Status = XDp_TxIicWrite(InstancePtr, XDP_SEGPTR_ADDR, 1, &SegPtr); + if (SegPtr != 0) { + SegPtr = 0; + XDp_TxIicWrite(InstancePtr, XDP_SEGPTR_ADDR, 1, &SegPtr); + } return Status; }