summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2017-12-18 17:21:43 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit3f0997d0ae089c057c589872b0227b5feb9d4585 (patch)
treeb0b4c2dcc971b3f870d93c46a1ce7ae501475cde /drivers/staging
parentd2b4cbfe81028887eb6e41ae0143cf4a149d24d7 (diff)
MLK-17237 staging: typec: return error when tcpci_parse_config has failed
Otherwise, the probe would be considered successfully, and without do any destroy jobs, eg, the interrupt has still registered. Acked-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/typec/tcpci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index e2913ea0d2c9..8d38d759e34f 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -632,7 +632,7 @@ const struct tcpc_config tcpci_tcpc_config = {
static int tcpci_parse_config(struct tcpci *tcpci)
{
struct tcpc_config *tcfg;
- int ret = 0;
+ int ret = -EINVAL;
tcpci->controls_vbus = true; /* XXX */
@@ -745,8 +745,10 @@ static int tcpci_parse_config(struct tcpci *tcpci)
device_property_read_u32(tcpci->dev, "max-snk-mw",
&tcfg->max_snk_mw) ||
device_property_read_u32(tcpci->dev, "op-snk-mw",
- &tcfg->operating_snk_mw))
+ &tcfg->operating_snk_mw)) {
+ ret = -EINVAL;
goto snk_setting_wrong;
+ }
return 0;