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 <y.oudjana@protonmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20221107153317.657803-1-y.oudjana@protonmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5c294de commit 341fd15

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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)