Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: acpiphp: Allow built-in drivers for Attention Indicators

Since the introduction of the attention callback in acpiphp, a non-zero
struct module *owner has been required in acpiphp_register_attention(). The
intent seemed to be that the core code could hold a refcount on the module
while invoking a callback.

This check accidentally precludes the possibility of attention callbacks to
built-in drivers.

Remove the check on `struct module *owner` in acpiphp_register_attention()
so attention callbacks can also be registered from built-in drivers.

Link: https://lore.kernel.org/r/20230930002036.6491-1-scott@os.amperecomputing.com
Signed-off-by: D Scott Phillips <scott@os.amperecomputing.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

D Scott Phillips and committed by
Bjorn Helgaas
33883eed 0bb80ecc

+1 -2
+1 -2
drivers/pci/hotplug/acpiphp_core.c
··· 78 78 { 79 79 int retval = -EINVAL; 80 80 81 - if (info && info->owner && info->set_attn && 82 - info->get_attn && !attention_info) { 81 + if (info && info->set_attn && info->get_attn && !attention_info) { 83 82 retval = 0; 84 83 attention_info = info; 85 84 }