]> www.infradead.org Git - linux.git/commit
platform/chrome: cros_ec_typec: add remove driver hook
authorThadeu Lima de Souza Cascardo <cascardo@igalia.com>
Fri, 26 Jul 2024 18:12:35 +0000 (15:12 -0300)
committerTzung-Bi Shih <tzungbi@kernel.org>
Fri, 9 Aug 2024 12:55:09 +0000 (20:55 +0800)
commita1927fbbf74f9f61eb5c6d1414037c97a8d942ab
treeb0f08bbb3a27bb5fc1870d08b3ca8c298d0e0b98
parent62be134abf4250474a7a694837064bc783d2b291
platform/chrome: cros_ec_typec: add remove driver hook

This allows the driver to be unbound and bound again. Otherwise, when
unbinding the driver, there will be leftover sysfs entries.

When rebinding the driver, it also ends up touching freed memory when
adding to the notifier chain as the old one was not removed and ends up
being traversed.

Add a remove_new driver hook, which removes the notifier from the chain and
unregisters the typec ports.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Link: https://lore.kernel.org/r/20240726181235.920335-1-cascardo@igalia.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
drivers/platform/chrome/cros_ec_typec.c