Linux ACPI
 help / color / mirror / Atom feed
* [PATCH] ACPI dock: move some functions to .init.text
       [not found] <20100618073950.GA12822@pengutronix.de>
@ 2010-06-21 13:31 ` Uwe Kleine-König
  2010-10-19  7:13   ` [PATCH RESEND] " Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2010-06-21 13:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg KH, Shaohua Li, Len Brown, Alex Chiang, Bob Moore, Lin Ming,
	linux-acpi

These functions are some of the few stoppers of moving
platform_device_register_data to .init.text, too.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/acpi/dock.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 3fe29e9..2b16563 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -929,7 +929,7 @@ static struct attribute_group dock_attribute_group = {
  * allocated and initialize a new dock station device.  Find all devices
  * that are on the dock station, and register for dock event notifications.
  */
-static int dock_add(acpi_handle handle)
+static int __init dock_add(acpi_handle handle)
 {
 	int ret, id;
 	struct dock_station ds, *dock_station;
@@ -1023,7 +1023,7 @@ static int dock_remove(struct dock_station *ds)
  *
  * This is called by acpi_walk_namespace to look for dock stations.
  */
-static acpi_status
+static __init acpi_status
 find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
 	if (is_dock(handle))
@@ -1032,7 +1032,7 @@ find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
 	return AE_OK;
 }
 
-static acpi_status
+static __init acpi_status
 find_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
 	/* If bay is a dock, it's already handled */
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH RESEND] ACPI dock: move some functions to .init.text
  2010-06-21 13:31 ` [PATCH] ACPI dock: move some functions to .init.text Uwe Kleine-König
@ 2010-10-19  7:13   ` Uwe Kleine-König
  2010-10-19 15:48     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2010-10-19  7:13 UTC (permalink / raw)
  To: linux-acpi; +Cc: linux-kernel, Greg KH, Shaohua Li, Len Brown

find_dock and find_bay are only called by dock_init which lives in
.init.text dock_add is only called by find_dock and find_bay.  So all
three functions can be moved to .init.text, too.

This fixes:

        WARNING: vmlinux.o(.text+0x2134b7): Section mismatch in reference from the function dock_add() to the function .init.text:platform_device_register_resndata()
        The function dock_add() references
        the function __init platform_device_register_resndata().
        This is often because dock_add lacks a __init
        annotation or the annotation of platform_device_register_resndata is wrong.

for a build with unset CONFIG_MODULES.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

since the first submission of the patch back in June I reworded the
commit log to make it (hopefully) more understandable.  Since then
platform_device_register_data was marked __init_or_module, so the
problem is real now (and only occurs with CONFIG_MODULES=n).

Best regards
Uwe

 drivers/acpi/dock.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 3fe29e9..2b16563 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -929,7 +929,7 @@ static struct attribute_group dock_attribute_group = {
  * allocated and initialize a new dock station device.  Find all devices
  * that are on the dock station, and register for dock event notifications.
  */
-static int dock_add(acpi_handle handle)
+static int __init dock_add(acpi_handle handle)
 {
 	int ret, id;
 	struct dock_station ds, *dock_station;
@@ -1023,7 +1023,7 @@ static int dock_remove(struct dock_station *ds)
  *
  * This is called by acpi_walk_namespace to look for dock stations.
  */
-static acpi_status
+static __init acpi_status
 find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
 	if (is_dock(handle))
@@ -1032,7 +1032,7 @@ find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
 	return AE_OK;
 }
 
-static acpi_status
+static __init acpi_status
 find_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
 {
 	/* If bay is a dock, it's already handled */
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH RESEND] ACPI dock: move some functions to .init.text
  2010-10-19  7:13   ` [PATCH RESEND] " Uwe Kleine-König
@ 2010-10-19 15:48     ` Greg KH
  2010-10-19 18:03       ` Len Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2010-10-19 15:48 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-acpi, linux-kernel, Shaohua Li, Len Brown

On Tue, Oct 19, 2010 at 09:13:39AM +0200, Uwe Kleine-König wrote:
> find_dock and find_bay are only called by dock_init which lives in
> .init.text dock_add is only called by find_dock and find_bay.  So all
> three functions can be moved to .init.text, too.
> 
> This fixes:
> 
>         WARNING: vmlinux.o(.text+0x2134b7): Section mismatch in reference from the function dock_add() to the function .init.text:platform_device_register_resndata()
>         The function dock_add() references
>         the function __init platform_device_register_resndata().
>         This is often because dock_add lacks a __init
>         annotation or the annotation of platform_device_register_resndata is wrong.
> 
> for a build with unset CONFIG_MODULES.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Greg Kroah-Hartman <gregkh@suse.de>

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

* Re: [PATCH RESEND] ACPI dock: move some functions to .init.text
  2010-10-19 15:48     ` Greg KH
@ 2010-10-19 18:03       ` Len Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Len Brown @ 2010-10-19 18:03 UTC (permalink / raw)
  To: Greg KH; +Cc: Uwe Kleine-König, linux-acpi, linux-kernel, Shaohua Li

applied

thanks,
Len Brown, Intel Open Source Technology Center


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

end of thread, other threads:[~2010-10-19 18:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100618073950.GA12822@pengutronix.de>
2010-06-21 13:31 ` [PATCH] ACPI dock: move some functions to .init.text Uwe Kleine-König
2010-10-19  7:13   ` [PATCH RESEND] " Uwe Kleine-König
2010-10-19 15:48     ` Greg KH
2010-10-19 18:03       ` Len Brown

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