mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 01:13:11 +00:00
usb: typec: tcpci: mask event interrupts when remove driver
This is to prevent any possible events generated while unregister
tpcm port.
Fixes: 74e656d6b0 ("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]>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e1f236efd9
commit
3ba76256fc
@@ -591,6 +591,12 @@ static int tcpci_probe(struct i2c_client *client,
|
||||
static int tcpci_remove(struct i2c_client *client)
|
||||
{
|
||||
struct tcpci_chip *chip = i2c_get_clientdata(client);
|
||||
int err;
|
||||
|
||||
/* Disable chip interrupts before unregistering port */
|
||||
err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
tcpci_unregister_port(chip->tcpci);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user