mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Russell King <rmk@arm.linux.org.uk>
Subject: [patch 4/6] tb0219: convert to the new platform device interface
Date: Wed, 11 Jan 2006 01:47:50 -0500	[thread overview]
Message-ID: <20060111065752.016420000.dtor_core@ameritech.net> (raw)
In-Reply-To: <20060111064746.560312000.dtor_core@ameritech.net>

[-- Attachment #1: tb02190-new-platform-interface.patch --]
[-- Type: text/plain, Size: 2153 bytes --]

tb0219: convert to the new platform device interface

Do not use platform_device_register_simple() as it is going away.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/char/tb0219.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

Index: work/drivers/char/tb0219.c
===================================================================
--- work.orig/drivers/char/tb0219.c
+++ work/drivers/char/tb0219.c
@@ -283,7 +283,7 @@ static void tb0219_pci_irq_init(void)
 	vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW);
 }
 
-static int tb0219_probe(struct platform_device *dev)
+static int __devinit tb0219_probe(struct platform_device *dev)
 {
 	int retval;
 
@@ -319,7 +319,7 @@ static int tb0219_probe(struct platform_
 	return 0;
 }
 
-static int tb0219_remove(struct platform_device *dev)
+static int __devexit tb0219_remove(struct platform_device *dev)
 {
 	_machine_restart = old_machine_restart;
 
@@ -335,19 +335,26 @@ static struct platform_device *tb0219_pl
 
 static struct platform_driver tb0219_device_driver = {
 	.probe		= tb0219_probe,
-	.remove		= tb0219_remove,
+	.remove		= __devexit_p(tb0219_remove),
 	.driver		= {
 		.name	= "TB0219",
+		.owner	= THIS_MODULE,
 	},
 };
 
-static int __devinit tanbac_tb0219_init(void)
+static int __init tanbac_tb0219_init(void)
 {
 	int retval;
 
-	tb0219_platform_device = platform_device_register_simple("TB0219", -1, NULL, 0);
-	if (IS_ERR(tb0219_platform_device))
-		return PTR_ERR(tb0219_platform_device);
+	tb0219_platform_device = platform_device_alloc("TB0219", -1);
+	if (!tb0219_platform_device)
+		return -ENOMEM;
+
+	retval = platform_device_add(tb0219_platform_device);
+	if (retval < 0) {
+		platform_device_put(tb0219_platform_device);
+		return retval;
+	}
 
 	retval = platform_driver_register(&tb0219_device_driver);
 	if (retval < 0)
@@ -356,10 +363,9 @@ static int __devinit tanbac_tb0219_init(
 	return retval;
 }
 
-static void __devexit tanbac_tb0219_exit(void)
+static void __exit tanbac_tb0219_exit(void)
 {
 	platform_driver_unregister(&tb0219_device_driver);
-
 	platform_device_unregister(tb0219_platform_device);
 }
 


  parent reply	other threads:[~2006-01-11  6:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-11  6:47 [patch 0/6] Assorted conversions " Dmitry Torokhov
2006-01-11  6:47 ` [patch 1/6] hdaps: convert " Dmitry Torokhov
2006-01-11  6:47 ` [patch 2/6] vr41xx: " Dmitry Torokhov
2006-01-11  6:47 ` [patch 3/6] mv64x600_wdt: " Dmitry Torokhov
2006-01-11  6:47 ` Dmitry Torokhov [this message]
2006-01-11  6:47 ` [patch 5/6] dcdbas: " Dmitry Torokhov
2006-01-11  6:47 ` [patch 6/6] serial8250: " Dmitry Torokhov
2006-01-16 22:27   ` Kumar Gala
2006-01-16 23:31     ` Russell King
2006-01-16 23:54       ` Kumar Gala
2006-01-17  2:35         ` Tony Lindgren
2006-01-17 19:36         ` Olaf Hering
2006-01-18  9:56           ` Russell King
2006-01-18 10:10             ` Olaf Hering
2006-01-18 11:03           ` Olaf Hering
2006-01-17 21:41         ` Grant Likely

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=20060111065752.016420000.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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

Powered by JetHome