Re: [PATCH] usb: typec: tcpm/tcpci_maxim: better interrupt name
From: Greg Kroah-Hartman
Date: Thu Feb 13 2025 - 08:23:53 EST
On Thu, Feb 13, 2025 at 01:10:49PM +0000, André Draszik wrote:
> Thanks Greg,
>
> On Thu, 2025-02-13 at 12:56 +0100, Greg Kroah-Hartman wrote:
> > At a quick glance, tcpci_register_port() is called earlier in the
> > function, but when you error out here you did not call
> > tcpci_unregister_port(). What else needs to also be unwound?
>
> This driver manages everything using devres, including calling of
> tcpci_unregister_port() via devres:
>
> ret = devm_add_action_or_reset(&client->dev,
> max_tcpci_unregister_tcpci_port,
> chip->tcpci);
>
> is done just after tcpci_register_port(). As far as I can see nothing
> needs to be unwound explicitly.
Ugh, that wasn't obvious at all, sorry about that. Yet another reason
to hate devm apis :)
thanks,
greg k-h