summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2019-01-08 09:32:08 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-13 13:52:15 -0800
commit914ea853c3ff2a79bdc7f050a1967c184c4485a3 (patch)
tree4bbf71de42f5d5ca926977fad5d7d47338f189f0 /driver
parent0d41bed0bccfdfd82361788cf89a37caff08dd9f (diff)
downloadchrome-ec-914ea853c3ff2a79bdc7f050a1967c184c4485a3.tar.gz
pd: Remove unneeded code from anx74xx.c tcpc driver
Remove unneeded mask from variable BUG=b:122109575 BRANCH=none TEST=manual Change-Id: I257233f73db4f76dc251814cde88ea38eaffef88 Signed-off-by: Sam Hurst <shurst@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1401122 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/tcpm/anx74xx.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/driver/tcpm/anx74xx.c b/driver/tcpm/anx74xx.c
index 178b56d4be..30438775b3 100644
--- a/driver/tcpm/anx74xx.c
+++ b/driver/tcpm/anx74xx.c
@@ -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,