Re: [PATCH v3] HID: i2c-hid: Refactor _DSM helper and add i2c-hid-acpi-prp0001 driver
From: 谢致邦 (XIE Zhibang) <hidden>
Date: 2026-06-09 10:22:16
Also in:
lkml, sashiko-reviews
Hi Hans, Thanks for the review. The current header-based approach lets i2c-hid-acpi-prp0001.c work independently by just including a header for the _DSM helper. Switching to EXPORT_SYMBOL_GPL would force prp0001 to depend on i2c-hid-acpi — a Kconfig "depends on I2C_HID_ACPI", plus module-level dependency at load time — all for sharing a single function. I find that hard to accept. I understand that adding a new header for one function is unusual, though it contains only a single static inline and introduces no runtime dependency between the two drivers. Looking back at the full discussion: Benjamin made it clear from the start that he doesn't want i2c-hid-of.c handling ACPI _DSM fallback. His line is that ACPI devices and OF devices should each go through their own drivers without cross-contamination. If you still prefer exporting the function from i2c-hid-acpi.c, then prp0001 would have to drag i2c-hid-acpi along with it — an independent leaf driver turned into something that can't stand alone. If you still prefer the export approach, then I'd rather take a simpler approach: add an of_match directly to i2c-hid-acpi.c, and return -ENODEV silently at the top of probe if hid-descr-addr is present. Same logic as the prp0001 driver, but one fewer file, no module dependency, no extra Kconfig entry, and no OF driver touching ACPI devices — which should also satisfy Benjamin's concern. [corrected: s/prototype/function/ — the header contains a definition, not just a declaration] Regards, Zhibang