Skip to content

Commit 3ba7625

Browse files
Junlisuzhougregkh
authored andcommitted
usb: typec: tcpci: mask event interrupts when remove driver
This is to prevent any possible events generated while unregister tpcm port. Fixes: 74e656d ("staging: typec: Type-C Port Controller Interface driver (tcpci)") Signed-off-by: Li Jun <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e1f236e commit 3ba7625

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/usb/typec/tcpm/tcpci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,12 @@ static int tcpci_probe(struct i2c_client *client,
591591
static int tcpci_remove(struct i2c_client *client)
592592
{
593593
struct tcpci_chip *chip = i2c_get_clientdata(client);
594+
int err;
595+
596+
/* Disable chip interrupts before unregistering port */
597+
err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, 0);
598+
if (err < 0)
599+
return err;
594600

595601
tcpci_unregister_port(chip->tcpci);
596602

0 commit comments

Comments
 (0)