extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered
authorYassine Oudjana <y.oudjana@protonmail.com>
Mon, 7 Nov 2022 15:33:17 +0000 (18:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:48 +0000 (13:14 +0100)
commit408dbaa0657861b1fe9feb95463d6f0fa661f6e4
tree71b94c61844c2f7f49f26cbc013f84e5a58475b6
parent2471a44769b53effd8f602ac87ca47a5d8710edb
extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered

commit 341fd15e2e18c24d5c738496cfc3d7a272241201 upstream.

Commit bf7571c00dca ("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: bf7571c00dca ("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>
drivers/extcon/extcon-usbc-tusb320.c