From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: driver core: platform: remove software node on release() Date: Sat, 16 May 2026 13:28:30 +1000 Message-ID: In-Reply-To: <20260512-swnode-remove-on-dev-unreg-v5-5-0035eff63812@oss.qualcomm.com> References: <20260512-swnode-remove-on-dev-unreg-v5-0-0035eff63812@oss.qualcomm.com> <20260512-swnode-remove-on-dev-unreg-v5-5-0035eff63812@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review This is the core fix. Adding `device_remove_software_node(dev)` at the top = of `platform_device_release()`: ```c static void platform_device_release(struct device *dev) { struct platform_object *pa =3D container_of(dev, struct platform_object, pdev.dev); device_remove_software_node(dev); of_node_put(pa->pdev.dev.of_node); ... ``` This correctly handles the case where a swnode was added via `device_add_so= ftware_node()` (the `.swnode` path). For managed swnodes (`.properties` pat= h), `device_remove_software_node()` is a no-op because `software_node_notif= y_remove()` already cleared the secondary fwnode during `device_del()`. The extra `fwnode_handle_get()` for the primary-fwnode-is-software-node cas= e is correct: ```c if (is_software_node(pdevinfo->fwnode)) fwnode_handle_get(pdevinfo->fwnode); ``` This prevents the new `device_remove_software_node()` in release from dropp= ing the refcount of a pre-existing software node that was passed as the pri= mary fwnode =E2=80=94 the caller owns that node's lifetime. The commit message could be slightly clearer: "it will fails" should be "it= will fail". No functional issues. --- Generated by Claude Code Patch Reviewer