Hi Heyi,
+UINT32 +MdioRead (
- IN CONST MARVELL_MDIO_PROTOCOL *This,
- IN UINT32 PhyAddr,
- IN UINT32 RegOff
- )
+{
- EFI_STATUS Status;
- UINT32 Data;
- Status = MdioOperation (
This,
PhyAddr,
RegOff,
FALSE,
&Data
);
- return EFI_ERROR(Status) ? 0 : Data;
+}
Can we really identify error status by return value of 0? In other words, is it impossible for the device to have some registers whose value is 0?
I think it is better to use similar form of MdioOperation, i.e. using dedicated Status and a buffer to hold the read value.
Indeed. Error handling and using data buffer by reference is implented in v2, I'm about to send now.
Best regards, Marcin