From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: wbsd-devel@list.drzeus.cx, linux-kernel@vger.kernel.org
Subject: [patch 1/3] wbsd: convert to the new platfrom device interface
Date: Thu, 15 Dec 2005 00:39:34 -0500 [thread overview]
Message-ID: <20051215054444.590158000.dtor_core@ameritech.net> (raw)
In-Reply-To: 20051215053933.125918000.dtor_core@ameritech.net
[-- Attachment #1: wbsd-new-platform-intf.patch --]
[-- Type: text/plain, Size: 1140 bytes --]
wbsd: convert to the new platfrom device interface
platform_device_register_simple() is going away, switch to
using platfrom_device_alloc() + platform_device_add(). Also
make sure that wbsd_driver gets unregistered when wbsd_init
fails.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/mmc/wbsd.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
Index: work/drivers/mmc/wbsd.c
===================================================================
--- work.orig/drivers/mmc/wbsd.c
+++ work/drivers/mmc/wbsd.c
@@ -2090,10 +2090,20 @@ static int __init wbsd_drv_init(void)
if (result < 0)
return result;
- wbsd_device = platform_device_register_simple(DRIVER_NAME, -1,
- NULL, 0);
- if (IS_ERR(wbsd_device))
- return PTR_ERR(wbsd_device);
+ wbsd_device = platform_device_alloc(DRIVER_NAME, -1);
+ if (!wbsd_device)
+ {
+ platform_driver_unregister(&wbsd_driver);
+ return -ENOMEM;
+ }
+
+ result = platform_device_add(wbsd_device);
+ if (result)
+ {
+ platform_device_put(wbsd_device);
+ platform_driver_unregister(&wbsd_driver);
+ return result;
+ }
}
return 0;
next prev parent reply other threads:[~2005-12-15 5:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-15 5:39 [patch 0/3] wbsd: convert to the new platfrom device interface and more Dmitry Torokhov
2005-12-15 5:39 ` Dmitry Torokhov [this message]
2005-12-15 16:08 ` [patch 1/3] wbsd: convert to the new platfrom device interface Pierre Ossman
2005-12-15 5:39 ` [patch 2/3] wbsd: run through Lindent Dmitry Torokhov
2005-12-15 6:52 ` Pierre Ossman
2005-12-15 6:54 ` Dmitry Torokhov
2005-12-15 5:39 ` [patch 3/3] wbsd: make use of ARRAY_SIZE() macro Dmitry Torokhov
2005-12-15 16:09 ` Pierre Ossman
2005-12-15 16:24 ` Russell King
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=20051215054444.590158000.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=drzeus-list@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=wbsd-devel@list.drzeus.cx \
/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