From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/xe/i2c: use device_create_managed_software_node() Date: Sat, 16 May 2026 11:52:19 +1000 Message-ID: In-Reply-To: <20260513-swnode-remove-on-dev-unreg-v6-3-f9c58939df27@oss.qualcomm.com> References: <20260513-swnode-remove-on-dev-unreg-v6-0-f9c58939df27@oss.qualcomm.com> <20260513-swnode-remove-on-dev-unreg-v6-3-f9c58939df27@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Clean and correct.** This converts xe_i2c from manually creating a software node as the primary fwnode to using `device_create_managed_software_node()`, which ties the software node's lifecycle to the device. Key changes: - `fwnode_create_software_node()` + `pdev->dev.fwnode = fwnode` is replaced by `device_create_managed_software_node(&pdev->dev, ...)` called after `platform_device_alloc()` but before `platform_device_add()`. - The explicit `fwnode_remove_software_node()` in `xe_i2c_unregister_adapter()` is correctly removed since the managed node self-cleans. - The `adapter_node` field is correctly removed from `struct xe_i2c`. The comment explaining why `platform_device_register_full()` isn't used (need the pdev handle before registration for `xe_i2c_notifier()`) is retained, which is good. Semantically, `device_create_managed_software_node()` called when `dev->fwnode` is NULL will set the software node as the primary fwnode (via `set_secondary_fwnode()` logic), matching the old behavior. The error path is also improved: on failure of `device_create_managed_software_node()`, we jump to `err_pdev_put` which calls `platform_device_put()`. The managed node will be properly cleaned up through the release path (especially after patch 4 unifies it). **Verdict**: Ack recommended for the DRM side. --- --- Generated by Claude Code Patch Reviewer