* [PATCH v6 5/5] regulator: RK808: remove redundant code
@ 2014-08-26 14:18 Chris Zhong
2014-08-26 21:08 ` Doug Anderson
2014-08-27 9:01 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Chris Zhong @ 2014-08-26 14:18 UTC (permalink / raw)
To: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, sameo,
lee.jones, lgirdwood, broonie, a.zummo, mturquette
Cc: devicetree, linux-kernel, rtc-linux, grant.likely, hl, huangtao,
cf, zhangqing, xxx, dianders, heiko, olof, sonnyrao, dtor,
javier.martinez, kever.yang, Chris Zhong
remove the redundant code, since pdata has been removed from stuct rk808
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
---
Changes in v6:
- remove the redundant code
Changes in v5:
- re-edit base on Mark's branch
Changes in v4:
- use &client->dev replace rk808->dev
Changes in v3: None
Changes in v2:
Adviced by Mark Browm:
- change of_find_node_by_name to find_child_by_name
- use RK808_NUM_REGULATORS as the name of the constant
- create a pdata when missing platform data
- use the rk808_reg name to supply_regulator name
- replace regulator_register with devm_regulator_register
- some other problem with coding styl
drivers/regulator/rk808-regulator.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index f00d6d8..f42952e 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -294,11 +294,10 @@ static struct of_regulator_match rk808_reg_matches[] = {
[RK808_ID_SWITCH2] = { .name = "SWITCH_REG2" },
};
-static int rk808_regulator_dts(struct rk808 *rk808)
+static int rk808_regulator_dts(struct i2c_client *client,
+ struct rk808_board *pdata)
{
struct device_node *np, *reg_np;
- struct i2c_client *client = rk808->i2c;
- struct rk808_board *pdata = rk808->pdata;
int i, ret;
np = client->dev.of_node;
@@ -335,7 +334,7 @@ static int rk808_regulator_probe(struct platform_device *pdev)
{
struct rk808 *rk808 = dev_get_drvdata(pdev->dev.parent);
struct i2c_client *client = rk808->i2c;
- struct rk808_board *pdata = rk808->pdata;
+ struct rk808_board *pdata = dev_get_platdata(&client->dev);
struct regulator_config config = {};
struct regulator_dev *rk808_rdev;
struct regulator_init_data *reg_data;
@@ -343,22 +342,15 @@ static int rk808_regulator_probe(struct platform_device *pdev)
int ret = 0;
if (!pdata) {
- dev_warn(&client->dev, "%s no pdata, create it\n", __func__);
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
}
- ret = rk808_regulator_dts(rk808);
+ ret = rk808_regulator_dts(client, pdata);
if (ret)
return ret;
- rk808->num_regulators = RK808_NUM_REGULATORS;
- rk808->rdev = devm_kzalloc(&pdev->dev, RK808_NUM_REGULATORS *
- sizeof(struct regulator_dev *), GFP_KERNEL);
- if (!rk808->rdev)
- return -ENOMEM;
-
/* Instantiate the regulators */
for (i = 0; i < RK808_NUM_REGULATORS; i++) {
reg_data = pdata->rk808_init_data[i];
@@ -382,7 +374,6 @@ static int rk808_regulator_probe(struct platform_device *pdev)
"failed to register %d regulator\n", i);
return PTR_ERR(rk808_rdev);
}
- rk808->rdev[i] = rk808_rdev;
}
return 0;
}
--
1.7.9.5
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v6 5/5] regulator: RK808: remove redundant code
2014-08-26 14:18 [PATCH v6 5/5] regulator: RK808: remove redundant code Chris Zhong
@ 2014-08-26 21:08 ` Doug Anderson
2014-08-27 9:01 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-08-26 21:08 UTC (permalink / raw)
To: Chris Zhong
Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, broonie,
Alessandro Zummo, Mike Turquette, devicetree, linux-kernel,
rtc-linux, Grant Likely, Lin Huang, Tao Huang, Eddie Cai,
zhangqing, xxx, Heiko Stübner, Olof Johansson, Sonny Rao,
Dmitry Torokhov, Javier Martinez Canillas, Kever Yang
Chris,
On Tue, Aug 26, 2014 at 7:18 AM, Chris Zhong <zyw@rock-chips.com> wrote:
> remove the redundant code, since pdata has been removed from stuct rk808
>
> Signed-off-by: Chris Zhong <zyw@rock-chips.com>
>
> ---
>
> Changes in v6:
> - remove the redundant code
>
> Changes in v5:
> - re-edit base on Mark's branch
>
> Changes in v4:
> - use &client->dev replace rk808->dev
>
> Changes in v3: None
> Changes in v2:
> Adviced by Mark Browm:
> - change of_find_node_by_name to find_child_by_name
> - use RK808_NUM_REGULATORS as the name of the constant
> - create a pdata when missing platform data
> - use the rk808_reg name to supply_regulator name
> - replace regulator_register with devm_regulator_register
> - some other problem with coding styl
>
> drivers/regulator/rk808-regulator.c | 17 ++++-------------
> 1 file changed, 4 insertions(+), 13 deletions(-)
Probably shouldn't land until we've solved problems around the
"platform data" in the MFD patch...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 5/5] regulator: RK808: remove redundant code
2014-08-26 14:18 [PATCH v6 5/5] regulator: RK808: remove redundant code Chris Zhong
2014-08-26 21:08 ` Doug Anderson
@ 2014-08-27 9:01 ` Mark Brown
2014-08-29 13:13 ` Doug Anderson
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2014-08-27 9:01 UTC (permalink / raw)
To: Chris Zhong
Cc: robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak, sameo,
lee.jones, lgirdwood, a.zummo, mturquette, devicetree,
linux-kernel, rtc-linux, grant.likely, hl, huangtao, cf,
zhangqing, xxx, dianders, heiko, olof, sonnyrao, dtor,
javier.martinez, kever.yang
[-- Attachment #1: Type: text/plain, Size: 314 bytes --]
On Tue, Aug 26, 2014 at 10:18:57PM +0800, Chris Zhong wrote:
> remove the redundant code, since pdata has been removed from stuct rk808
I've applied this but if there's further changes needed please wait
until the MFD changes they depend on have been accepted before
resending. This will be less work all round.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 5/5] regulator: RK808: remove redundant code
2014-08-27 9:01 ` Mark Brown
@ 2014-08-29 13:13 ` Doug Anderson
2014-08-29 18:56 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Doug Anderson @ 2014-08-29 13:13 UTC (permalink / raw)
To: Mark Brown
Cc: Chris Zhong, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
Kumar Gala, Samuel Ortiz, Lee Jones, Liam Girdwood,
Alessandro Zummo, Mike Turquette, devicetree, linux-kernel,
rtc-linux, Grant Likely, Lin Huang, Tao Huang, Eddie Cai,
zhangqing, xxx, Heiko Stübner, Olof Johansson, Sonny Rao,
Dmitry Torokhov, Javier Martinez Canillas, Kever Yang
Mark,
On Wed, Aug 27, 2014 at 2:01 AM, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Aug 26, 2014 at 10:18:57PM +0800, Chris Zhong wrote:
>> remove the redundant code, since pdata has been removed from stuct rk808
>
> I've applied this but if there's further changes needed please wait
> until the MFD changes they depend on have been accepted before
> resending. This will be less work all round.
Can you clarify? As Chris makes the MFD changes that Lee and others
have requested then the regulator driver needs to change as well.
It's helpful for reviewers (and testers) of Chris's changes to see how
the regulator driver changes as the MFD interface changes. Should he
just take you off the CC list until he's ready?
I've asked Chris to please send out the next version of the series
(including the regulator changes needed) since I'd like to see
feedback addressed. If that doesn't match what you want him to do,
please yell at me and not at him...
Thanks!
-Doug
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 5/5] regulator: RK808: remove redundant code
2014-08-29 13:13 ` Doug Anderson
@ 2014-08-29 18:56 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2014-08-29 18:56 UTC (permalink / raw)
To: Doug Anderson
Cc: Chris Zhong, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
Kumar Gala, Samuel Ortiz, Lee Jones, Liam Girdwood,
Alessandro Zummo, Mike Turquette, devicetree, linux-kernel,
rtc-linux, Grant Likely, Lin Huang, Tao Huang, Eddie Cai,
zhangqing, xxx, Heiko Stübner, Olof Johansson, Sonny Rao,
Dmitry Torokhov, Javier Martinez Canillas, Kever Yang
[-- Attachment #1: Type: text/plain, Size: 966 bytes --]
On Fri, Aug 29, 2014 at 06:13:10AM -0700, Doug Anderson wrote:
> On Wed, Aug 27, 2014 at 2:01 AM, Mark Brown <broonie@kernel.org> wrote:
> > On Tue, Aug 26, 2014 at 10:18:57PM +0800, Chris Zhong wrote:
> >> remove the redundant code, since pdata has been removed from stuct rk808
> > I've applied this but if there's further changes needed please wait
> > until the MFD changes they depend on have been accepted before
> > resending. This will be less work all round.
> Can you clarify? As Chris makes the MFD changes that Lee and others
> have requested then the regulator driver needs to change as well.
> It's helpful for reviewers (and testers) of Chris's changes to see how
> the regulator driver changes as the MFD interface changes. Should he
> just take you off the CC list until he's ready?
Yes, the frequent resends of MFD serieses are in general a problem and
since these ones still don't seem to be getting threaded they're
especially problematic.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-08-29 18:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26 14:18 [PATCH v6 5/5] regulator: RK808: remove redundant code Chris Zhong
2014-08-26 21:08 ` Doug Anderson
2014-08-27 9:01 ` Mark Brown
2014-08-29 13:13 ` Doug Anderson
2014-08-29 18:56 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®