mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rhyland Klein <rklein@nvidia.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: Joseph Lo <josephl@nvidia.com>,
	Stephen Warren <swarren@wwwdotorg.org>,
	<linux-kernel@vger.kernel.org>, Rhyland Klein <rklein@nvidia.com>
Subject: [v2 PATCH] regulator: palmas: Store pdata pointer in palmas struct
Date: Thu, 25 Jul 2013 13:04:59 -0400	[thread overview]
Message-ID: <1374771899-5037-1-git-send-email-rklein@nvidia.com> (raw)

Store a pointer to the pdata so that if it needs to be used after
probe it can be. In the case of booting from DeviceTree, the
dev.platform_data may be null, so we need to store this pointer
explicitly.

Based on work by Joseph Lo.

Cc: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---

v2:
 - Renamed patch from "regulator: palmas: fix pdata ptr not be updated
   after it has been allocated" to be appropriate to the current change.
 - Instead of updating dev.platform_data, store the pdata pointer in the
   pmic struct which we already have access to via drvdata.

 drivers/regulator/palmas-regulator.c |    2 +-
 include/linux/mfd/palmas.h           |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index d0c8785..750ce55 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -761,7 +761,6 @@ static void palmas_dt_to_pdata(struct device *dev,
 	pdata->ldo6_vibrator = of_property_read_bool(node, "ti,ldo6-vibrator");
 }
 
-
 static int palmas_regulators_probe(struct platform_device *pdev)
 {
 	struct palmas *palmas = dev_get_drvdata(pdev->dev.parent);
@@ -789,6 +788,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
 
 	pmic->dev = &pdev->dev;
 	pmic->palmas = palmas;
+	pmic->pdata = pdata;
 	palmas->pmic = pmic;
 	platform_set_drvdata(pdev, pmic);
 
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 1a8dd7a..1703f18 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -352,6 +352,8 @@ struct palmas_pmic {
 	struct regulator_dev *rdev[PALMAS_NUM_REGS];
 	struct mutex mutex;
 
+	struct palmas_pmic_platform_data *pdata;
+
 	int smps123;
 	int smps457;
 
-- 
1.7.9.5


             reply	other threads:[~2013-07-25 17:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 17:04 Rhyland Klein [this message]
2013-07-25 18:02 ` Mark Brown
2013-07-25 18:06   ` Rhyland Klein

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=1374771899-5037-1-git-send-email-rklein@nvidia.com \
    --to=rklein@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=josephl@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swarren@wwwdotorg.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

Powered by JetHome