mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Use of __init in asus_acpi.c + sony_acpi.c?
@ 2006-02-26  9:42 Sam Ravnborg
  2006-03-01 19:15 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2006-02-26  9:42 UTC (permalink / raw)
  To: len.brown, LKML, linux-acpi

When running the section mismatch check on latest -mm I see:

WARNING: drivers/acpi/asus_acpi.o - Section mismatch: reference to \
.init.text:asus_hotk_add from .data between 'asus_hotk_driver' (at \
offset 0xe0) and 'model_conf'
WARNING: drivers/acpi/sony_acpi.o - Section mismatch: reference to \
.init.text:sony_acpi_add from .data between 'sony_acpi_driver' (at \
offset 0xe0) and 'sony_acpi_values'
WARNING: drivers/acpi/sony_acpi.o - Section mismatch: reference to    \
.exit.text:sony_acpi_remove from .data between 'sony_acpi_driver' (at \
offset 0xe8) and 'sony_acpi_values'

Browsing the source I see that this is assignments to struct acpi_driver
structure:

static struct acpi_driver asus_hotk_driver = {
	.name = ACPI_HOTK_NAME,
	.class = ACPI_HOTK_CLASS,
	.ids = ACPI_HOTK_HID,
	.ops = {
		.add = asus_hotk_add,          <==== __init
		.remove	= asus_hotk_remove,
	},
};


>From browsing the code I cannot see when this happens.
In asus_acpi.c and sony_acpi.c the .add and .remove methods are
declared __init/__exit indicating that the add method is solely used
during early init of the module.

Is it correct that acpi_bus_register_driver() is only called during the
early init phase of a drivers and so we can discard the .add methods
after first usage?

Likewise for .remove that this is only used when a module is unloaded
and so can be discarded when builtin?

Either asus_acpi.c and sony_acpi.c needs updates or the rest of
acpi_driver needs an update (fails to use __init, __exit).

	Sam



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-01 20:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-26  9:42 Use of __init in asus_acpi.c + sony_acpi.c? Sam Ravnborg
2006-03-01 19:15 ` Bjorn Helgaas
2006-03-01 20:51   ` [PATCH] ACPI: remove __init/__exit from Asus and Sony .add()/.remove() methods Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®