linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: len.brown@intel.com, LKML <linux-kernel@vger.kernel.org>,
	linux-acpi@vger.kernel.org,
	Karol Kozimor <sziwan@users.sourceforge.net>,
	Julien Lerouge <julien.lerouge@free.fr>,
	acpi4asus-user@lists.sourceforge.net,
	Stelian Pop <stelian@popies.net>
Subject: Re: Use of __init in asus_acpi.c + sony_acpi.c?
Date: Wed, 1 Mar 2006 12:15:59 -0700	[thread overview]
Message-ID: <200603011215.59604.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <20060226094206.GA9871@mars.ravnborg.org>

On Sunday 26 February 2006 02:42, Sam Ravnborg wrote:
> 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'
> ...
> 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?

I think this is a bug in asus_acpi.c and sony_acpi.c.  They assume
that their devices can not be hot-plugged, so if they aren't found
at the time of acpi_bus_register_driver(), they can discard the
.add() methods.

It is true that these particular devices can't be hot-plugged, but
there's no way to tell that to acpi_bus_register_driver(), so we have
to assume .add() could be called as long as the driver remains
registered.

I'll cook up a patch for asus_acpi.c and sony_acpi.c.  Thanks for
finding this.

Bjorn

  reply	other threads:[~2006-03-01 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-26  9:42 Use of __init in asus_acpi.c + sony_acpi.c? Sam Ravnborg
2006-03-01 19:15 ` Bjorn Helgaas [this message]
2006-03-01 20:51   ` [PATCH] ACPI: remove __init/__exit from Asus and Sony .add()/.remove() methods Bjorn Helgaas

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=200603011215.59604.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=acpi4asus-user@lists.sourceforge.net \
    --cc=julien.lerouge@free.fr \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    --cc=stelian@popies.net \
    --cc=sziwan@users.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).