[PATCH 0/2] driver core: remove software node from platform devices on device release

From: Bartosz Golaszewski

Date: Fri Apr 10 2026 - 07:53:40 EST


This fixes an issue in platform device code where, if we specify a
software node for a platform device using struct platform_device_info,
it will not be removed on device .release().

The second patch adds a test-case that can be used to reproduce the
problem and prove that the fix works.

First patch should go into v7.1 while patch 2/2 can be queued for v7.2.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
---
Bartosz Golaszewski (2):
driver core: platform: remove software node on release()
driver core: platform: tests: add a test case for correct swnode removal

drivers/base/platform.c | 1 +
drivers/base/test/platform-device-test.c | 62 ++++++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
---
base-commit: 3fa7d958829eb9bc3b469ed07f11de3d2804ef71
change-id: 20260410-swnode-remove-on-dev-unreg-42bfc4b23ba8

Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>