All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-omap@vger.kernel.org,
	"Uwe Kleine-König" <ukleinek@strlen.de>,
	"Russell King" <rmk+kernel@arm.linux.org.uk>
Subject: Re: [PATCH 1/5] Fix sections for omap-mcbsp platform driver
Date: Wed, 24 Sep 2008 16:47:36 +0300	[thread overview]
Message-ID: <20080924134736.GR5222@atomide.com> (raw)
In-Reply-To: <1222262955-13599-2-git-send-email-tony@atomide.com>

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

* Tony Lindgren <tony@atomide.com> [080924 16:29]:
> From: Uwe Kleine-König <ukleinek@strlen.de>
> 
> 	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/unbind
> 	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/bind
> 
> While at it move the remove function to the .devexit.text section.

Looks like I managed to trash the subject on this one, here's a fixed
version.

Tony

[-- Attachment #2: 0001-Don-t-use-__init-but-__devinit-to-define-probe-funct.patch --]
[-- Type: text/x-diff, Size: 2057 bytes --]

>From f4ca1382337bfb1bf612fa07c2bb0207b1a5da37 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Uwe=20Kleine-K=C3=B6nig?= <ukleinek@strlen.de>
Date: Wed, 24 Sep 2008 16:13:11 +0300
Subject: [PATCH] Fix sections for omap-mcbsp platform driver
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Don't use __init but __devinit to define probe function.  A pointer to
omap_mcbsp_probe is passed to the core via platform_driver_register and
so the function must not disappear when the init code is freed.  Using
__init and having HOTPLUG=y the following probably oopses:

	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/unbind
	echo -n omap-mcbsp.1 > /sys/bus/platform/driver/omap-mcbsp/bind

While at it move the remove function to the .devexit.text section.

Signed-off-by: Uwe Kleine-König <ukleinek@strlen.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index e63990f..e0803a8 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -804,7 +804,7 @@ EXPORT_SYMBOL(omap_mcbsp_set_spi_mode);
  * McBSP1 and McBSP3 are directly mapped on 1610 and 1510.
  * 730 has only 2 McBSP, and both of them are MPU peripherals.
  */
-static int __init omap_mcbsp_probe(struct platform_device *pdev)
+static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
 {
 	struct omap_mcbsp_platform_data *pdata = pdev->dev.platform_data;
 	int id = pdev->id - 1;
@@ -868,7 +868,7 @@ exit:
 	return ret;
 }
 
-static int omap_mcbsp_remove(struct platform_device *pdev)
+static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
 {
 	struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev);
 
@@ -894,7 +894,7 @@ static int omap_mcbsp_remove(struct platform_device *pdev)
 
 static struct platform_driver omap_mcbsp_driver = {
 	.probe		= omap_mcbsp_probe,
-	.remove		= omap_mcbsp_remove,
+	.remove		= __devexit_p(omap_mcbsp_remove),
 	.driver		= {
 		.name	= "omap-mcbsp",
 	},

  parent reply	other threads:[~2008-09-24 13:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24 13:29 [PATCH 0/5] Omap McBSP updates from linux-omap tree, v2 Tony Lindgren
2008-09-24 13:29 ` [PATCH 1/5] Don't use __init but __devinit to define probe function. A pointer to Tony Lindgren
2008-09-24 13:29   ` [PATCH 2/5] ARM: OMAP: Allocate McBSP devices dynamically Tony Lindgren
2008-09-24 13:29     ` [PATCH 3/5] ARM: OMAP: Add support for McBSP devices 3 - 5 on 34xx Tony Lindgren
2008-09-24 13:29       ` [PATCH 4/5] ARM: OMAP: Add support for OMAP2430 in McBSP Tony Lindgren
2008-09-24 13:29         ` [PATCH 5/5] ARM: OMAP: Fixes to omap_mcbsp_request function Tony Lindgren
2008-10-04 14:37           ` Russell King - ARM Linux
2008-10-07 18:43             ` Russell King - ARM Linux
2008-10-07 18:48             ` Russell King - ARM Linux
2008-10-08  7:32               ` git-pull request for omap mcbsp changes (Re: [PATCH 5/5] ARM: OMAP: Fixes to omap_mcbsp_request function) Tony Lindgren
2008-10-09 14:29                 ` Russell King - ARM Linux
2008-10-04 14:36         ` [PATCH 4/5] ARM: OMAP: Add support for OMAP2430 in McBSP Russell King - ARM Linux
2008-10-04 14:35       ` [PATCH 3/5] ARM: OMAP: Add support for McBSP devices 3 - 5 on 34xx Russell King - ARM Linux
2008-10-04 14:33     ` [PATCH 2/5] ARM: OMAP: Allocate McBSP devices dynamically Russell King - ARM Linux
2008-09-24 13:47   ` Tony Lindgren [this message]
2008-10-04 14:33     ` [PATCH 1/5] Fix sections for omap-mcbsp platform driver Russell King - ARM Linux

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=20080924134736.GR5222@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=ukleinek@strlen.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.