From: Thierry Reding <thierry.reding@avionic-design.de>
To: Bill Huang <bilhuang@nvidia.com>
Cc: sameo@linux.intel.com, grant.likely@secretlab.ca,
rob.herring@calxeda.com, rob@landley.net,
broonie@opensource.wolfsonmicro.com, ldewangan@nvidia.com,
swarren@wwwdotorg.org, xxie@nvidia.com, lrg@slimlogic.co.uk,
jhovold@gmail.com, kyle.manna@fuel7.com, rklein@nvidia.com,
devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mfd: dt: tps6586x: Add power off control
Date: Fri, 17 Aug 2012 12:41:50 +0200 [thread overview]
Message-ID: <20120817104150.GA27633@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1345194989-11614-2-git-send-email-bilhuang@nvidia.com>
[-- Attachment #1: Type: text/plain, Size: 1396 bytes --]
On Fri, Aug 17, 2012 at 02:16:28AM -0700, Bill Huang wrote:
[...]
> diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
[...]
> @@ -505,6 +519,11 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
> goto err_add_devs;
> }
>
> + tps6586x_dev = &client->dev;
> +
> + if (pdata->pm_off && !pm_power_off)
> + pm_power_off = tps6586x_power_off;
> +
I think the assignment of tps6586x_dev needs to go inside the if block
as well. Otherwise it might be overwritten by another instance for
systems that actually have more than one tps6586x. Since currently the
driver can't be built as a module it probably makes little sense to
clean this up in .remove(), but it might still be worth adding so it
isn't forgotten if and when somebody tries to convert the driver to a
module.
I should note that I don't like very much how the pm_power_off works.
Maybe this should really be changed to allow passing a context for the
function to work from. Something like:
pm_power_off = tps6586x_power_off;
pm_power_off_data = &client->dev;
Where pm_power_off() would receive pm_power_off_data as an argument.
Even that's not very pretty. On the other hand this doesn't really buy
us much because only the storage location of the variable would change
and nothing else. But it would still make the association of the data
clearer.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-08-17 10:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-17 9:16 [PATCH 0/2] mfd: dt: add power off support for Tegra20/Tegra30 Bill Huang
[not found] ` <1345194989-11614-1-git-send-email-bilhuang-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-17 9:16 ` [PATCH 1/2] mfd: dt: tps6586x: Add power off control Bill Huang
2012-08-17 10:41 ` Thierry Reding [this message]
[not found] ` <20120817104150.GA27633-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-08-17 22:45 ` Bill Huang
[not found] ` <1345194989-11614-2-git-send-email-bilhuang-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-17 19:05 ` Stephen Warren
2012-08-17 9:16 ` [PATCH 2/2] mfd: dt: tps65910: add " Bill Huang
2012-08-17 10:42 ` Thierry Reding
2012-08-17 19:06 ` Stephen Warren
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=20120817104150.GA27633@avionic-0098.mockup.avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=bilhuang@nvidia.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=jhovold@gmail.com \
--cc=kyle.manna@fuel7.com \
--cc=ldewangan@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=rklein@nvidia.com \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=sameo@linux.intel.com \
--cc=swarren@wwwdotorg.org \
--cc=xxie@nvidia.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;
as well as URLs for NNTP newsgroup(s).