Skip to content

Commit 341fd15

Browse files
Tooniisgregkh
authored andcommitted
extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered
Commit bf7571c ("extcon: usbc-tusb320: Add USB TYPE-C support") added an optional Type-C interface to the driver but missed to check if it is in use when calling the IRQ handler. This causes an oops on devices currently using the old extcon interface. Check if a Type-C port is registered before calling the Type-C IRQ handler. Fixes: bf7571c ("extcon: usbc-tusb320: Add USB TYPE-C support") Signed-off-by: Yassine Oudjana <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5c294de commit 341fd15

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/extcon/extcon-usbc-tusb320.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,13 @@ static irqreturn_t tusb320_irq_handler(int irq, void *dev_id)
327327
return IRQ_NONE;
328328

329329
tusb320_extcon_irq_handler(priv, reg);
330-
tusb320_typec_irq_handler(priv, reg);
330+
331+
/*
332+
* Type-C support is optional. Only call the Type-C handler if a
333+
* port had been registered previously.
334+
*/
335+
if (priv->port)
336+
tusb320_typec_irq_handler(priv, reg);
331337

332338
regmap_write(priv->regmap, TUSB320_REG9, reg);
333339

0 commit comments

Comments
 (0)