Skip to content

Commit

Permalink
driver core: Call in reversed order in device_platform_notify_remove()
Browse files Browse the repository at this point in the history
It's logically correct to call the removal notifiers in the reversed order
as it might be dependent to each other. Luckily, platform_notify_remove()
currently is not used and the others have no dependency use, but theoretically
it's still possible.

Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
andy-shev authored and gregkh committed Aug 22, 2023
1 parent d21fdd0 commit 29c8ab7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2306,12 +2306,12 @@ static void device_platform_notify(struct device *dev)

static void device_platform_notify_remove(struct device *dev)
{
acpi_device_notify_remove(dev);
if (platform_notify_remove)
platform_notify_remove(dev);

software_node_notify_remove(dev);

if (platform_notify_remove)
platform_notify_remove(dev);
acpi_device_notify_remove(dev);
}

/**
Expand Down

0 comments on commit 29c8ab7

Please sign in to comment.