From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Haojian Zhuang <hzhuang1@marvell.com>
Cc: "sameo@linux.intel.com" <sameo@linux.intel.com>,
"haojian.zhuang@gmail.com" <haojian.zhuang@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"lrg@slimlogic.co.uk" <lrg@slimlogic.co.uk>
Subject: Re: [PATCH 13/14] regulator: max8925: fix not add device if missing init data
Date: Thu, 21 Apr 2011 13:03:28 +0100 [thread overview]
Message-ID: <20110421120327.GD11788@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <25B60CDC2F704E4E9D88FFD52780CB4C05CF0EF027@SC-VEXCH1.marvell.com>
On Thu, Apr 21, 2011 at 04:13:28AM -0700, Haojian Zhuang wrote:
> >> +static struct regulator_init_data
> >regulator_pdata[ARRAY_SIZE(regulator_devs)];
> >That looks really suspicious, what happens if there's two of these
> >devices in the system?
> It's impossible to use two PMIC in one system. At least, I didn't hear.
I don't believe that. It's not going to be a common case but it will be
possible.
> >It's really unclear why the array is needed at all if you're registering
> >the devices one at a time.
> Although there're a lot of regulators, maybe only parts of them are used.
> So only add the necessary one. Others will be passed. The number is got
> from platform data.
You're missing the point here. You're registering a device at a time
but for some reason the platform data is being stored in an array in
order to pass it in, even though only a single element in the array is
in use.
> >> - if (pdata && pdata->regulator[0]) {
> >> - ret = mfd_add_devices(chip->dev, 0, ®ulator_devs[0],
> >> - ARRAY_SIZE(regulator_devs),
> >> - ®ulator_resources[0], 0);
> >> - if (ret < 0) {
> >> - dev_err(chip->dev, "Failed to add regulator subdev\n");
> >> - goto out_dev;
> >> - }
> >Surely the only change that's needed here is to remove the check to see
> >if pdata->regulator[0] is non-null?
> All above changes are necessary to me.
What makes you say this? If you remove the check for the first entry
being null then the driver will go and register all the regulators which
seems fine. That seems like it fixes the problem with skipping all the
regulators if the first one has no platform data.
You're really not explaining the changes you're trying to make here
terribly well, the changes you're making seem very substantial relative
to what you say you're trying to do.
next prev parent reply other threads:[~2011-04-21 12:03 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2011041801>
2011-04-18 14:03 ` [PATCH v2 00/14] Update 88pm860x and max8925 MFD driver Haojian Zhuang
2011-04-18 14:03 ` [PATCH 01/14] input: touchscreen: use polling mode in 88pm860x Haojian Zhuang
2011-04-18 14:03 ` [PATCH 02/14] input: touchscreen: move initialization " Haojian Zhuang
2011-04-26 8:57 ` Samuel Ortiz
2011-04-18 14:04 ` [PATCH 03/14] rtc: add 88pm860x rtc Haojian Zhuang
2011-04-26 8:58 ` Samuel Ortiz
2011-04-18 14:04 ` [PATCH 04/14] input: set the long press detection in 88pm860x onkey Haojian Zhuang
2011-04-18 14:04 ` [PATCH 05/14] w1: add DS278x slave driver Haojian Zhuang
2011-04-18 14:04 ` [PATCH 06/14] mfd: pxa-w1: MFD driver for PXA 1wire control + DS1WM chip Haojian Zhuang
2011-04-26 9:48 ` Samuel Ortiz
2011-05-14 14:21 ` Haojian Zhuang
2011-05-14 19:40 ` Russell King - ARM Linux
2011-05-14 22:23 ` Mark Brown
2011-05-22 20:00 ` Samuel Ortiz
2011-04-18 14:04 ` [PATCH 07/14] mfd: fix build warning on 88pm860x Haojian Zhuang
2011-04-26 9:49 ` Samuel Ortiz
2011-04-26 16:44 ` Haojian Zhuang
2011-04-26 16:47 ` Samuel Ortiz
2011-04-18 14:04 ` [PATCH 08/14] mfd: use platform_data in max8925 Haojian Zhuang
2011-04-20 11:54 ` Haojian Zhuang
2011-04-26 9:45 ` Samuel Ortiz
2011-04-18 14:04 ` [PATCH 09/14] input: get irq from resource in max8925 onkey Haojian Zhuang
2011-04-18 14:04 ` [PATCH 10/14] rtc: avoid to use hardcoding irq number in max8925 Haojian Zhuang
2011-04-18 14:04 ` [PATCH 11/14] power_supply: max8925: use platform_data from cell Haojian Zhuang
2011-04-18 21:49 ` Anton Vorontsov
2011-05-02 15:15 ` Samuel Ortiz
2011-04-18 14:04 ` [PATCH 12/14] regulator: max8925: enable i2c sequence for control Haojian Zhuang
2011-04-18 14:27 ` Mark Brown
2011-05-02 15:16 ` Samuel Ortiz
2011-04-18 14:04 ` [PATCH 13/14] regulator: check name in initialization of max8925 Haojian Zhuang
2011-04-18 14:28 ` Mark Brown
2011-04-18 15:33 ` Haojian Zhuang
2011-04-18 16:04 ` Mark Brown
2011-04-19 2:42 ` Haojian Zhuang
2011-04-19 8:09 ` Mark Brown
2011-04-19 8:28 ` Haojian Zhuang
2011-04-19 10:51 ` Mark Brown
2011-04-19 11:33 ` Haojian Zhuang
2011-04-20 11:55 ` [PATCH 13/14] regulator: max8925: fix not add device if missing init data Haojian Zhuang
2011-04-21 10:42 ` Mark Brown
2011-04-21 11:13 ` Haojian Zhuang
2011-04-21 12:03 ` Mark Brown [this message]
2011-04-21 15:23 ` Haojian Zhuang
2011-04-21 18:32 ` Mark Brown
2011-04-18 14:04 ` [PATCH 14/14] regulator: 88pm8607: avoid to use constraint name in driver Haojian Zhuang
2011-04-18 14:30 ` Mark Brown
2011-04-18 15:38 ` Haojian Zhuang
2011-04-18 16:02 ` Mark Brown
2011-04-19 2:45 ` Haojian Zhuang
2011-04-19 8:13 ` Mark Brown
2011-04-19 11:34 ` Haojian Zhuang
2011-04-20 11:56 ` Haojian Zhuang
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=20110421120327.GD11788@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=haojian.zhuang@gmail.com \
--cc=hzhuang1@marvell.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;
as well as URLs for NNTP newsgroup(s).