pd: Remove unneeded code from anx74xx.c tcpc driver
Remove unneeded mask from variable
BRANCH=none
TEST=manual
Commit-Ready: ChromeOS CL Exonerator Bot
Tested-by: Sam Hurst
@@ -854,16 +854,15 @@ static int anx74xx_tcpm_get_vbus_level(int port)
static int anx74xx_tcpm_get_message_raw(int port, uint32_t *payload, int *head)
{
- int reg = 0, rv = EC_SUCCESS;
- int len = 0;
+ int reg;
+ int len;
/* Fetch the header */
- rv |= tcpc_read16(port, ANX74XX_REG_PD_HEADER, &reg);
- if (rv) {
+ if (tcpc_read16(port, ANX74XX_REG_PD_HEADER, &reg)) {
clear_recvd_msg_int(port);
return EC_ERROR_UNKNOWN;
}
- *head = reg & 0x0000ffff;
+ *head = reg;
#ifdef CONFIG_USB_PD_DECODE_SOP
*head |= PD_HEADER_SOP(msg_sop[port]);
#endif
@@ -877,11 +876,7 @@ static int anx74xx_tcpm_get_message_raw(int port, uint32_t *payload, int *head)
/* Receive message : assuming payload have enough
* memory allocated
*/
- rv |= anx74xx_read_pd_obj(port, (uint8_t *)payload, len);
- if (rv)
- return EC_ERROR_UNKNOWN;
-
- return rv;
+ return anx74xx_read_pd_obj(port, (uint8_t *)payload, len);
}
static int anx74xx_tcpm_transmit(int port, enum tcpm_transmit_type type,
