From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: backlight: apple_bl: Convert to a platform driver
Date: Mon, 16 Mar 2026 11:59:44 +1000 [thread overview]
Message-ID: <review-patch1-5084777.GXAFRqVoOG@rafael.j.wysocki> (raw)
In-Reply-To: <5084777.GXAFRqVoOG@rafael.j.wysocki>
Patch Review
**Overall**: This is a correct and straightforward ACPI-to-platform driver conversion. No functional issues found.
**Positive observations:**
1. The `#include <linux/platform_device.h>` addition is correctly placed in alphabetical order.
2. The function signatures are updated correctly:
- `apple_bl_add(struct acpi_device *dev)` → `apple_bl_probe(struct platform_device *pdev)` — the rename from `add` to `probe` follows platform driver convention.
- `apple_bl_remove(struct acpi_device *dev)` → `apple_bl_remove(struct platform_device *pdev)` — the `void` return type matches `platform_driver.remove` (line 241 of `platform_device.h`).
3. The driver struct conversion is correct:
```c
static struct platform_driver apple_bl_driver = {
.probe = apple_bl_probe,
.remove = apple_bl_remove,
.driver = {
.name = "Apple backlight",
.acpi_match_table = apple_bl_ids,
},
};
```
The `acpi_match_table` correctly replaces the old `.ids` field, keeping the same `apple_bl_ids` array.
4. The init/exit functions correctly switch from `acpi_bus_register_driver`/`acpi_bus_unregister_driver` to `platform_driver_register`/`platform_driver_unregister`.
**Minor observation (not a bug):**
- Neither the old `acpi_device *dev` parameter nor the new `platform_device *pdev` parameter is actually used inside `apple_bl_probe()` or `apple_bl_remove()`. The driver relies entirely on global state (`hw_data`, `apple_backlight_device`). This is a pre-existing pattern and not something introduced by this patch, so it's fine to leave it as-is. However, a follow-up could pass `&pdev->dev` to `backlight_device_register()` instead of `NULL` (line 182-183), which would create a proper device hierarchy in sysfs. This is purely optional.
- The `MODULE_DEVICE_TABLE(acpi, apple_bl_ids)` at line 242 is correctly retained, ensuring module autoloading still works.
**Reviewed-by worthy**: Yes, this patch is correct and ready.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-03-16 1:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-14 11:50 [PATCH v1] backlight: apple_bl: Convert to a platform driver Rafael J. Wysocki
2026-03-16 1:59 ` Claude review: " Claude Code Review Bot
2026-03-16 1:59 ` Claude Code Review Bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch1-5084777.GXAFRqVoOG@rafael.j.wysocki \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox