On Mon, Apr 15, 2024 at 07:17:16PM +0300, Andy Shevchenko wrote: > On Mon, Apr 15, 2024 at 5:09 PM Charles Keepax > <ckeepax@xxxxxxxxxxxxxxxxxxxxx> wrote: > > From: Maciej Strozek <mstrozek@xxxxxxxxxxxxxxxxxxxxx> > > +static int cs42l43_spi_remove(struct platform_device *pdev) > > +{ > > + struct cs42l43 *cs42l43 = dev_get_drvdata(pdev->dev.parent); > > + struct fwnode_handle *fwnode = dev_fwnode(cs42l43->dev); > > + bool has_sidecar = cs42l43_has_sidecar(fwnode); > > + > > + if (has_sidecar) > > + software_node_unregister(&cs42l43_gpiochip_swnode); > > + > > + return 0; > > As this one. > > > +}; > > You will remove the software node before removing the controller, this > seems incorrect ordering to me. What you need is to wrap by > devm_add_action_or_reset() and it won't be any remove() callback > needed. > Yeah this is a good idea I will update. Thanks, Charles