summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-11-12 11:29:04 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-12 23:01:33 +0000
commitfdd8a7c50bbcd8f001405bf0d7f473ec34a85475 (patch)
treec94010c548b79492ab527f0092ed5af3f798dfba
parent6149037b9d0cf9f803b43e72f6cfdbe231fa3be1 (diff)
downloadchrome-ec-fdd8a7c50bbcd8f001405bf0d7f473ec34a85475.tar.gz
TCPMv2: Print VID/PID only when present
Not all partners will reply to DiscoverIdentity, so only print out their VID/PID combination when the VID is non-zero. BRANCH=None BUG=None TEST=on drawcia, plug in a charger which does not reply to DiscoverIdentity and verify it doesn't print Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I1ea114794ada20b68cb6f902b085a2fd02650912 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2535216 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--common/usb_pd_dual_role.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/usb_pd_dual_role.c b/common/usb_pd_dual_role.c
index 5d516cc7d9..fc70a6099a 100644
--- a/common/usb_pd_dual_role.c
+++ b/common/usb_pd_dual_role.c
@@ -373,7 +373,10 @@ int pd_charge_from_device(uint16_t vid, uint16_t pid)
pid == allow_list[i].pid)
return 1;
}
- CPRINTS("allow_list[] pair not found: vid=0x%X pid=0x%X", vid, pid);
+
+ if (vid != 0)
+ CPRINTS("allow_list[] pair not found: vid=0x%X pid=0x%X",
+ vid, pid);
return 0;
}