From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: kyungmin.park@samsung.com, marco.stornelli@gmail.com
Subject: + ramoops-use-the-platform-data-structure-instead-of-module-params.patch added to -mm tree
Date: Wed, 18 Aug 2010 15:59:01 -0700 [thread overview]
Message-ID: <201008182259.o7IMx14o016875@imap1.linux-foundation.org> (raw)
The patch titled
ramoops: use the platform data structure instead of module params
has been added to the -mm tree. Its filename is
ramoops-use-the-platform-data-structure-instead-of-module-params.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: ramoops: use the platform data structure instead of module params
From: Kyungmin Park <kyungmin.park@samsung.com>
As each board and system has different memory for ramoops. It's better to
define the platform data instead of module params.
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marco Stornelli <marco.stornelli@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/char/ramoops.c | 29 +++++++++++++++++++++++++++--
include/linux/ramoops.h | 15 +++++++++++++++
2 files changed, 42 insertions(+), 2 deletions(-)
diff -puN drivers/char/ramoops.c~ramoops-use-the-platform-data-structure-instead-of-module-params drivers/char/ramoops.c
--- a/drivers/char/ramoops.c~ramoops-use-the-platform-data-structure-instead-of-module-params
+++ a/drivers/char/ramoops.c
@@ -25,6 +25,8 @@
#include <linux/time.h>
#include <linux/io.h>
#include <linux/ioport.h>
+#include <linux/platform_device.h>
+#include <linux/ramoops.h>
#define RAMOOPS_KERNMSG_HDR "===="
#define RAMOOPS_HEADER_SIZE (5 + sizeof(struct timeval))
@@ -91,11 +93,17 @@ static void ramoops_do_dump(struct kmsg_
cxt->count = (cxt->count + 1) % cxt->max_count;
}
-static int __init ramoops_init(void)
+static int __init ramoops_probe(struct platform_device *pdev)
{
+ struct ramoops_platform_data *pdata = pdev->dev.platform_data;
struct ramoops_context *cxt = &oops_cxt;
int err = -EINVAL;
+ if (pdata) {
+ mem_size = pdata->mem_size;
+ mem_address = pdata->mem_address;
+ }
+
if (!mem_size) {
printk(KERN_ERR "ramoops: invalid size specification");
goto fail3;
@@ -142,7 +150,7 @@ fail3:
return err;
}
-static void __exit ramoops_exit(void)
+static void __exit ramoops_remove(void)
{
struct ramoops_context *cxt = &oops_cxt;
@@ -153,6 +161,23 @@ static void __exit ramoops_exit(void)
release_mem_region(cxt->phys_addr, cxt->size);
}
+static struct platform_driver ramoops_driver = {
+ .remove = __exit_p(ramoops_remove),
+ .driver = {
+ .name = "ramoops",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init ramoops_init(void)
+{
+ return platform_driver_probe(&ramoops_driver, ramoops_probe);
+}
+
+static void __exit ramoops_exit(void)
+{
+ platform_driver_unregister(&ramoops_driver);
+}
module_init(ramoops_init);
module_exit(ramoops_exit);
diff -puN /dev/null include/linux/ramoops.h
--- /dev/null
+++ a/include/linux/ramoops.h
@@ -0,0 +1,15 @@
+#ifndef __RAMOOPS_H
+#define __RAMOOPS_H
+
+/*
+ * Ramoops platform data
+ * @mem_size memory size for ramoops
+ * @mem_address physical memory address to contain ramoops
+ */
+
+struct ramoops_platform_data {
+ unsigned long mem_size;
+ unsigned long mem_address;
+};
+
+#endif
_
Patches currently in -mm which might be from kyungmin.park@samsung.com are
linux-next.patch
s5pc110-sdhci-s3c-can-override-host-capabilities.patch
s5pc110-sdhci-s3c-support-on-s5pc110.patch
sdhci-add-no-hi-speed-bit-quirk-support.patch
ramoops-use-the-platform-data-structure-instead-of-module-params.patch
reply other threads:[~2010-08-18 22:59 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=201008182259.o7IMx14o016875@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marco.stornelli@gmail.com \
--cc=mm-commits@vger.kernel.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