aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrĂ© Draszik <[email protected]>2024-07-10 11:36:17 +0100
committerGreg Kroah-Hartman <[email protected]>2024-08-07 12:49:30 +0200
commit4d39e00481a6b15440872ada4c25614edb76199b (patch)
tree281be5f80d11d49fca2f13af6018d5f536ab2034
parent064e7e5a5d5f489cbce34ec8efe39199bfa7e1f7 (diff)
usb: typec: tcpm/tcpci_maxim: drop STATUS_CHECK()
Only one user of STATUS_CHECK() remains, and the code can actually be made more legible by simply avoiding the use of that wrapper macro, allowing to also drop the macro altogether. Do so. Signed-off-by: AndrĂ© Draszik <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/usb/typec/tcpm/maxim_contaminant.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/typec/tcpm/maxim_contaminant.c b/drivers/usb/typec/tcpm/maxim_contaminant.c
index e7687aeb69c0..8ac8eeade277 100644
--- a/drivers/usb/typec/tcpm/maxim_contaminant.c
+++ b/drivers/usb/typec/tcpm/maxim_contaminant.c
@@ -46,8 +46,6 @@ enum fladc_select {
#define READ1_SLEEP_MS 10
#define READ2_SLEEP_MS 5
-#define STATUS_CHECK(reg, mask, val) (((reg) & (mask)) == (val))
-
#define IS_CC_OPEN(cc_status) \
(FIELD_GET(TCPC_CC_STATUS_CC1, cc_status) == TCPC_CC_STATE_SRC_OPEN \
&& FIELD_GET(TCPC_CC_STATUS_CC2, cc_status) == TCPC_CC_STATE_SRC_OPEN)
@@ -368,7 +366,7 @@ bool max_contaminant_is_contaminant(struct max_tcpci_chip *chip, bool disconnect
}
return false;
} else if (chip->contaminant_state == DETECTED) {
- if (STATUS_CHECK(cc_status, TCPC_CC_STATUS_TOGGLING, 0)) {
+ if (!(cc_status & TCPC_CC_STATUS_TOGGLING)) {
chip->contaminant_state = max_contaminant_detect_contaminant(chip);
if (chip->contaminant_state == DETECTED) {
max_contaminant_enable_dry_detection(chip);