Skip to contentSkip to conversation

platform/chrome: cros-ec-typec: Cleanup use of check_features

PATCH Applied Prashant Malani 3 participants 3 messages Sep 23, 2021 – Sep 30, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/chrome: cros-ec-typec: Cleanup use of check_features

cros_ec_check_features() now returns a boolean. Remove the double NOT operator since it's not required anymore.

No functional changes are expected with this patch.

---
 drivers/platform/chrome/cros_ec_typec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/platform/chrome/cros_ec_typec.c +2 -3
index 262a891eded3..7b3afb6cda5d 100644
@@ -1116,9 +1116,8 @@ static int cros_typec_probe(struct platform_device *pdev)
 	}
 
 	ec_dev = dev_get_drvdata(&typec->ec->ec->dev);
-	typec->typec_cmd_supported = !!cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
-	typec->needs_mux_ack = !!cros_ec_check_features(ec_dev,
-							EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);
+	typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
+	typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);
 
 	ret = cros_typec_ec_command(typec, 0, EC_CMD_USB_PD_PORTS, NULL, 0,
 				    &resp, sizeof(resp));
Signature · 1 line
2.33.0.685.g46640cef36-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Prashant Malani

cros_ec_check_features() now returns a boolean. Remove the double NOT operator since it's not required anymore.

No functional changes are expected with this patch.

Quoted 23 lines
---
 drivers/platform/chrome/cros_ec_typec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/platform/chrome/cros_ec_typec.c +2 -4
index 262a891eded3..7b3afb6cda5d 100644
@@ -1116,9 +1116,8 @@ static int cros_typec_probe(struct platform_device *pdev)
        }
 
        ec_dev = dev_get_drvdata(&typec->ec->ec->dev);
-       typec->typec_cmd_supported = !!cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
-       typec->needs_mux_ack = !!cros_ec_check_features(ec_dev,
-                                                       EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);
+       typec->typec_cmd_supported = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_CMD);
+       typec->needs_mux_ack = cros_ec_check_features(ec_dev, EC_FEATURE_TYPEC_MUX_REQUIRE_AP_ACK);
 
        ret = cros_typec_ec_command(typec, 0, EC_CMD_USB_PD_PORTS, NULL, 0,
                                    &resp, sizeof(resp));
--

2.33.0.685.g46640cef36-goog

#2 lore raw
In reply to Prashant Malani
Quoted 4 lines · Prashant Malani

cros_ec_check_features() now returns a boolean. Remove the double NOT operator since it's not required anymore.

No functional changes are expected with this patch.

Applied, thanks!

[1/1] platform/chrome: cros-ec-typec: Cleanup use of check_features

      commit: 73eff8602ad10cb55cdb614241b18f3d842abbe1

Best regards,

Signature · 1 line
Enric Balletbo i Serra <[email protected]>