From: "Mark A. Greer" <mgreer@mvista.com>
To: akpm <akpm@osdl.org>
Cc: Embedded PPC Linux list <linuxppc-embedded@ozlabs.org>
Subject: [PATCH][PPC32] cpci690 update
Date: Wed, 26 Jan 2005 11:13:48 -0700 [thread overview]
Message-ID: <41F7DDDC.8090304@mvista.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 190 bytes --]
Hi Andrew,
This patch updates the cpci690 platform file. The platform file now
uses the platform_notify hook to update platform_data.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
--
[-- Attachment #2: cpci690.patch --]
[-- Type: text/plain, Size: 2232 bytes --]
diff -Nru a/arch/ppc/platforms/cpci690.c b/arch/ppc/platforms/cpci690.c
--- a/arch/ppc/platforms/cpci690.c 2005-01-26 11:11:50 -07:00
+++ b/arch/ppc/platforms/cpci690.c 2005-01-26 11:11:50 -07:00
@@ -289,35 +289,6 @@
return;
}
-static int __init
-cpci690_fixup_pd(void)
-{
-#if defined(CONFIG_SERIAL_MPSC)
- struct list_head *entry;
- struct platform_device *pd;
- struct device *dev;
- struct mpsc_pd_dd *dd;
-
- list_for_each(entry, &platform_bus_type.devices.list) {
- dev = container_of(entry, struct device, bus_list);
- pd = container_of(dev, struct platform_device, dev);
-
- if (!strncmp(pd->name, MPSC_CTLR_NAME, BUS_ID_SIZE)) {
- dd = (struct mpsc_pd_dd *) dev_get_drvdata(&pd->dev);
-
- dd->max_idle = 40;
- dd->default_baud = 9600;
- dd->brg_clk_src = 8;
- dd->brg_clk_freq = 133000000;
- }
- }
-#endif
-
- return 0;
-}
-
-subsys_initcall(cpci690_fixup_pd);
-
static void __init
cpci690_setup_arch(void)
{
@@ -359,6 +330,50 @@
return;
}
+/* Platform device data fixup routines. */
+#if defined(CONFIG_SERIAL_MPSC)
+static void __init
+cpci690_fixup_mpsc_pdata(struct platform_device *pdev)
+{
+ struct mpsc_pdata *pdata;
+
+ pdata = (struct mpsc_pdata *)pdev->dev.platform_data;
+
+ pdata->max_idle = 40;
+ pdata->default_baud = 9600;
+ pdata->brg_clk_src = 8;
+ pdata->brg_clk_freq = 133000000;
+
+ return;
+}
+
+static int __init
+cpci690_platform_notify(struct device *dev)
+{
+ static struct {
+ char *bus_id;
+ void ((*rtn)(struct platform_device *pdev));
+ } dev_map[] = {
+ { MPSC_CTLR_NAME "0", cpci690_fixup_mpsc_pdata },
+ { MPSC_CTLR_NAME "1", cpci690_fixup_mpsc_pdata },
+ };
+ struct platform_device *pdev;
+ int i;
+
+ if (dev && dev->bus_id)
+ for (i=0; i<ARRAY_SIZE(dev_map); i++)
+ if (!strncmp(dev->bus_id, dev_map[i].bus_id,
+ BUS_ID_SIZE)) {
+
+ pdev = container_of(dev,
+ struct platform_device, dev);
+ dev_map[i].rtn(pdev);
+ }
+
+ return 0;
+}
+#endif
+
static void
cpci690_reset_board(void)
{
@@ -488,6 +503,10 @@
ppc_md.setup_io_mappings = cpci690_map_io;
ppc_md.early_serial_map = cpci690_early_serial_map;
#endif /* CONFIG_KGDB */
+
+#if defined(CONFIG_SERIAL_MPSC)
+ platform_notify = cpci690_platform_notify;
+#endif
return;
}
reply other threads:[~2005-01-26 18:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=41F7DDDC.8090304@mvista.com \
--to=mgreer@mvista.com \
--cc=akpm@osdl.org \
--cc=linuxppc-embedded@ozlabs.org \
/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;
as well as URLs for NNTP newsgroup(s).