From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 8/9] ARM: S3C24XX: Use s3c_set_platdata() helper
Date: Fri, 28 May 2010 07:19:18 +0100 [thread overview]
Message-ID: <1275027559-29278-9-git-send-email-ben-linux@fluff.org> (raw)
In-Reply-To: <1275027559-29278-1-git-send-email-ben-linux@fluff.org>
Commit f8b5ea089d5a447a8933a6540ceeccbcb78f9e53 added a helper
to copy and set platform data, so let's replace the various sites
in the Samsung support where this is happening.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
arch/arm/plat-s3c24xx/devs.c | 23 ++++-------------------
1 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 452e184..028c8bd 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -149,9 +149,8 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
{
struct s3c2410fb_mach_info *npd;
- npd = kmemdup(pd, sizeof(*npd), GFP_KERNEL);
+ npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd);
if (npd) {
- s3c_device_lcd.dev.platform_data = npd;
npd->displays = kmemdup(pd->displays,
sizeof(struct s3c2410fb_display) * npd->num_displays,
GFP_KERNEL);
@@ -223,15 +222,7 @@ EXPORT_SYMBOL(s3c_device_usbgadget);
void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
{
- struct s3c2410_udc_mach_info *npd;
-
- npd = kmalloc(sizeof(*npd), GFP_KERNEL);
- if (npd) {
- memcpy(npd, pd, sizeof(*npd));
- s3c_device_usbgadget.dev.platform_data = npd;
- } else {
- printk(KERN_ERR "no memory for udc platform data\n");
- }
+ s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget);
}
/* IIS */
@@ -341,15 +332,9 @@ struct platform_device s3c_device_sdi = {
EXPORT_SYMBOL(s3c_device_sdi);
-void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
+void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pd)
{
- struct s3c24xx_mci_pdata *npd;
-
- npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL);
- if (!npd)
- printk(KERN_ERR "%s: no memory to copy pdata", __func__);
-
- s3c_device_sdi.dev.platform_data = npd;
+ s3c_set_platdata(pd, sizeof(struct s3c24xx_mci_pdata), &s3c_device_sdi);
}
--
1.6.3.3
next prev parent reply other threads:[~2010-05-28 6:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 6:19 Samsung device updates Ben Dooks
2010-05-28 6:19 ` [PATCH 1/9] ARM: SAMSUNG: Default s3c_device_i2c1 Ben Dooks
2010-05-28 6:19 ` [PATCH 2/9] ARM: SAMSUNG: Remove s3c_i2c1_setname() calls for s3c2440-i2c Ben Dooks
2010-05-28 6:19 ` [PATCH 3/9] ARM: SAMSUNG: Default s3c_device_i2c2 to s3c2440-i2c Ben Dooks
2010-05-28 6:19 ` [PATCH 4/9] ARM: SAMSUNG: Default s3c_device_i2c0 " Ben Dooks
2010-05-28 6:19 ` [PATCH 5/9] ARM: SAMSUNG: Eliminate s3c2440-i2c renames Ben Dooks
2010-05-28 6:19 ` [PATCH 6/9] ARM: SAMSUNG: Add helper to clone and set platform data Ben Dooks
2010-05-28 6:19 ` [PATCH 7/9] ARM: SAMSUNG: Use s3c_set_platdata() helper Ben Dooks
2010-05-28 6:19 ` Ben Dooks [this message]
2010-05-28 6:19 ` [PATCH 9/9] ARM: S3C64XX: " Ben Dooks
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=1275027559-29278-9-git-send-email-ben-linux@fluff.org \
--to=ben-linux@fluff.org \
--cc=linux-arm-kernel@lists.infradead.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).