* [PATCH] IP32: Add platform devices for audio and volume button
@ 2008-07-04 23:12 Thomas Bogendoerfer
2008-07-04 23:25 ` Ralf Baechle
2008-07-05 8:22 ` [SPAM] " Geert Uytterhoeven
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2008-07-04 23:12 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
Create platform devices for audio and volume button driver.
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---
arch/mips/sgi-ip32/ip32-platform.c | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/arch/mips/sgi-ip32/ip32-platform.c b/arch/mips/sgi-ip32/ip32-platform.c
index 89a71f4..2ee401b 100644
--- a/arch/mips/sgi-ip32/ip32-platform.c
+++ b/arch/mips/sgi-ip32/ip32-platform.c
@@ -65,6 +65,42 @@ static __init int meth_devinit(void)
device_initcall(meth_devinit);
+static __init int sgio2audio_devinit(void)
+{
+ struct platform_device *pd;
+ int ret;
+
+ pd = platform_device_alloc("sgio2audio", -1);
+ if (!pd)
+ return -ENOMEM;
+
+ ret = platform_device_add(pd);
+ if (ret)
+ platform_device_put(pd);
+
+ return ret;
+}
+
+device_initcall(sgio2audio_devinit);
+
+static __init int sgio2btns_devinit(void)
+{
+ struct platform_device *pd;
+ int ret;
+
+ pd = platform_device_alloc("sgio2btns", -1);
+ if (!pd)
+ return -ENOMEM;
+
+ ret = platform_device_add(pd);
+ if (ret)
+ platform_device_put(pd);
+
+ return ret;
+}
+
+device_initcall(sgio2btns_devinit);
+
MODULE_AUTHOR("Ralf Baechle <ralf@linux-mips.org>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("8250 UART probe driver for SGI IP32 aka O2");
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] IP32: Add platform devices for audio and volume button
2008-07-04 23:12 [PATCH] IP32: Add platform devices for audio and volume button Thomas Bogendoerfer
@ 2008-07-04 23:25 ` Ralf Baechle
2008-07-05 8:22 ` [SPAM] " Geert Uytterhoeven
1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2008-07-04 23:25 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-mips
On Sat, Jul 05, 2008 at 01:12:13AM +0200, Thomas Bogendoerfer wrote:
> Create platform devices for audio and volume button driver.
Thanks, queued for 2.6.27,
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [SPAM] [PATCH] IP32: Add platform devices for audio and volume button
2008-07-04 23:12 [PATCH] IP32: Add platform devices for audio and volume button Thomas Bogendoerfer
2008-07-04 23:25 ` Ralf Baechle
@ 2008-07-05 8:22 ` Geert Uytterhoeven
1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2008-07-05 8:22 UTC (permalink / raw)
To: Thomas Bogendoerfer; +Cc: linux-mips, ralf
On Sat, 5 Jul 2008, Thomas Bogendoerfer wrote:
> +static __init int sgio2audio_devinit(void)
> +{
> + struct platform_device *pd;
> + int ret;
> +
> + pd = platform_device_alloc("sgio2audio", -1);
> + if (!pd)
> + return -ENOMEM;
> +
> + ret = platform_device_add(pd);
> + if (ret)
> + platform_device_put(pd);
This sequence is exactly what platform_device_register_simple() does, right?
BTW, I'm also still wondering what's the most efficient way of creating
platform devices. There's also platform_device_register()...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-05 8:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-04 23:12 [PATCH] IP32: Add platform devices for audio and volume button Thomas Bogendoerfer
2008-07-04 23:25 ` Ralf Baechle
2008-07-05 8:22 ` [SPAM] " Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox