From: Laxman Dewangan <ldewangan@nvidia.com>
To: <grant.likely@secretlab.ca>, <linus.walleij@stericsson.com>,
<sameo@linux.intel.com>, <broonie@opensource.wolfsonmicro.com>,
<lrg@slimlogic.co.uk>
Cc: <linux-kernel@vger.kernel.org>, Laxman Dewangan <ldewangan@nvidia.com>
Subject: [PATCH 1/3] mfd: save device node parsed platform data for sub devices
Date: Sat, 19 May 2012 02:01:41 +0530 [thread overview]
Message-ID: <1337373103-23933-2-git-send-email-ldewangan@nvidia.com> (raw)
In-Reply-To: <1337373103-23933-1-git-send-email-ldewangan@nvidia.com>
Save the allocated memory to store the parsed device node information
to the global device structure so that sub devices can directly use this
pointer.
In this way, the sub devices does not require to re-allocate the
memory for storing the sub-devices specific device node information.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/mfd/tps65910.c | 6 +++++-
include/linux/mfd/tps65910.h | 3 +++
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 18b30cf..05d449b 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -209,14 +209,17 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c,
{
struct tps65910 *tps65910;
struct tps65910_board *pmic_plat_data;
+ struct tps65910_board *of_pmic_plat_data = NULL;
struct tps65910_platform_data *init_data;
int ret = 0;
int chip_id = id->driver_data;
pmic_plat_data = dev_get_platdata(&i2c->dev);
- if (!pmic_plat_data && i2c->dev.of_node)
+ if (!pmic_plat_data && i2c->dev.of_node) {
pmic_plat_data = tps65910_parse_dt(i2c, &chip_id);
+ of_pmic_plat_data = pmic_plat_data;
+ }
if (!pmic_plat_data)
return -EINVAL;
@@ -229,6 +232,7 @@ static __devinit int tps65910_i2c_probe(struct i2c_client *i2c,
if (tps65910 == NULL)
return -ENOMEM;
+ tps65910->of_plat_data = of_pmic_plat_data;
i2c_set_clientdata(i2c, tps65910);
tps65910->dev = &i2c->dev;
tps65910->i2c_client = i2c;
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index ab04e90..dd8dc0a 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -830,6 +830,9 @@ struct tps65910 {
struct tps65910_rtc *rtc;
struct tps65910_power *power;
+ /* Device node parsed board data */
+ struct tps65910_board *of_plat_data;
+
/* IRQ Handling */
struct mutex irq_lock;
int chip_irq;
--
1.7.1.1
next prev parent reply other threads:[~2012-05-18 20:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-18 20:31 [PATCH 0/3] mfd: tps65910: dt: cleanups in device node parsing Laxman Dewangan
2012-05-18 20:31 ` Laxman Dewangan [this message]
2012-05-18 20:31 ` [PATCH 2/3] mfd: remove the parsing of dt info for gpio Laxman Dewangan
2012-05-18 20:31 ` [PATCH 3/3] gpio: tps65910: dt: process gpio specific device node info Laxman Dewangan
2012-05-18 23:31 ` Grant Likely
2012-05-22 21:51 ` [PATCH 0/3] mfd: tps65910: dt: cleanups in device node parsing Samuel Ortiz
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=1337373103-23933-2-git-send-email-ldewangan@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=sameo@linux.intel.com \
/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
Powered by JetHome