Skip to content

Commit

Permalink
usb: ulpi: Move of_node_put to ulpi_dev_release
Browse files Browse the repository at this point in the history
commit 092f45b upstream.

Drivers are not unbound from the device when ulpi_unregister_interface
is called. Move of_node-freeing code to ulpi_dev_release which is called
only after all users are gone.

Fixes: ef6a7bc ("usb: ulpi: Support device discovery via DT")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20220127190004.1446909-2-sean.anderson@seco.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
sean-anderson-seco authored and gregkh committed Feb 16, 2022
1 parent 9681823 commit 5751b4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/common/ulpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static const struct attribute_group *ulpi_dev_attr_groups[] = {

static void ulpi_dev_release(struct device *dev)
{
of_node_put(dev->of_node);
kfree(to_ulpi_dev(dev));
}

Expand Down Expand Up @@ -299,7 +300,6 @@ EXPORT_SYMBOL_GPL(ulpi_register_interface);
*/
void ulpi_unregister_interface(struct ulpi *ulpi)
{
of_node_put(ulpi->dev.of_node);
device_unregister(&ulpi->dev);
}
EXPORT_SYMBOL_GPL(ulpi_unregister_interface);
Expand Down

0 comments on commit 5751b4a

Please sign in to comment.