* [PATCH 1/2] regulator: rk808: Remove unused variables
@ 2014-09-11 10:21 Axel Lin
2014-09-11 10:22 ` [PATCH 2/2] regulator: rk808: Fix missing of_node_put Axel Lin
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Axel Lin @ 2014-09-11 10:21 UTC (permalink / raw)
To: Mark Brown; +Cc: Chris Zhong, Doug Anderson, Liam Girdwood, linux-kernel
Also remove non-informative comment.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/rk808-regulator.c | 26 --------------------------
1 file changed, 26 deletions(-)
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index d91f2b6..9557428 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -28,32 +28,6 @@
#define RK808_BUCK4_VSEL_MASK 0xf
#define RK808_LDO_VSEL_MASK 0x1f
-static const int buck_set_vol_base_addr[] = {
- RK808_BUCK1_ON_VSEL_REG,
- RK808_BUCK2_ON_VSEL_REG,
- RK808_BUCK3_CONFIG_REG,
- RK808_BUCK4_ON_VSEL_REG,
-};
-
-static const int buck_contr_base_addr[] = {
- RK808_BUCK1_CONFIG_REG,
- RK808_BUCK2_CONFIG_REG,
- RK808_BUCK3_CONFIG_REG,
- RK808_BUCK4_CONFIG_REG,
-};
-
-static const int ldo_set_vol_base_addr[] = {
- RK808_LDO1_ON_VSEL_REG,
- RK808_LDO2_ON_VSEL_REG,
- RK808_LDO3_ON_VSEL_REG,
- RK808_LDO4_ON_VSEL_REG,
- RK808_LDO5_ON_VSEL_REG,
- RK808_LDO6_ON_VSEL_REG,
- RK808_LDO7_ON_VSEL_REG,
- RK808_LDO8_ON_VSEL_REG,
-};
-
-/* rk808 voltage number */
static const struct regulator_linear_range rk808_buck_voltage_ranges[] = {
REGULATOR_LINEAR_RANGE(700000, 0, 63, 12500),
};
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] regulator: rk808: Fix missing of_node_put
2014-09-11 10:21 [PATCH 1/2] regulator: rk808: Remove unused variables Axel Lin
@ 2014-09-11 10:22 ` Axel Lin
2014-09-12 22:28 ` Doug Anderson
2014-09-12 13:53 ` [PATCH 1/2] regulator: rk808: Remove unused variables Mark Brown
2014-09-12 22:20 ` Doug Anderson
2 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2014-09-11 10:22 UTC (permalink / raw)
To: Mark Brown; +Cc: Chris Zhong, Doug Anderson, Liam Girdwood, linux-kernel
1. Pass &pdev->dev rather than &client->dev to of_regulator_match, the *dev
argument is used for devres to ensure devm_of_regulator_put_matches() will
be called when unload the module.
2. of_get_child_by_name() returns a node pointer with refcount incremented.
Thus add missing of_node_put(reg_np).
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/rk808-regulator.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index 9557428..07b0eb4 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -281,8 +281,9 @@ static int rk808_regulator_probe(struct platform_device *pdev)
if (!reg_np)
return -ENXIO;
- ret = of_regulator_match(&client->dev, reg_np, rk808_reg_matches,
+ ret = of_regulator_match(&pdev->dev, reg_np, rk808_reg_matches,
RK808_NUM_REGULATORS);
+ of_node_put(reg_np);
if (ret < 0)
return ret;
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] regulator: rk808: Fix missing of_node_put
2014-09-11 10:22 ` [PATCH 2/2] regulator: rk808: Fix missing of_node_put Axel Lin
@ 2014-09-12 22:28 ` Doug Anderson
0 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-09-12 22:28 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Chris Zhong, Liam Girdwood, linux-kernel
Axel,
On Thu, Sep 11, 2014 at 3:22 AM, Axel Lin <axel.lin@ingics.com> wrote:
> 1. Pass &pdev->dev rather than &client->dev to of_regulator_match, the *dev
> argument is used for devres to ensure devm_of_regulator_put_matches() will
> be called when unload the module.
>
> 2. of_get_child_by_name() returns a node pointer with refcount incremented.
> Thus add missing of_node_put(reg_np).
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/rk808-regulator.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
I've tested that things still work fine after applying this patch and
confirmed both of your statements are true to the best of my
knowledge. I haven't tested module removal (which is where some of
this matters) but what's here looks good.
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
-Doug
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] regulator: rk808: Remove unused variables
2014-09-11 10:21 [PATCH 1/2] regulator: rk808: Remove unused variables Axel Lin
2014-09-11 10:22 ` [PATCH 2/2] regulator: rk808: Fix missing of_node_put Axel Lin
@ 2014-09-12 13:53 ` Mark Brown
2014-09-12 22:20 ` Doug Anderson
2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2014-09-12 13:53 UTC (permalink / raw)
To: Axel Lin; +Cc: Chris Zhong, Doug Anderson, Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 120 bytes --]
On Thu, Sep 11, 2014 at 06:21:10PM +0800, Axel Lin wrote:
> Also remove non-informative comment.
Applied both, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] regulator: rk808: Remove unused variables
2014-09-11 10:21 [PATCH 1/2] regulator: rk808: Remove unused variables Axel Lin
2014-09-11 10:22 ` [PATCH 2/2] regulator: rk808: Fix missing of_node_put Axel Lin
2014-09-12 13:53 ` [PATCH 1/2] regulator: rk808: Remove unused variables Mark Brown
@ 2014-09-12 22:20 ` Doug Anderson
2 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2014-09-12 22:20 UTC (permalink / raw)
To: Axel Lin; +Cc: Mark Brown, Chris Zhong, Liam Girdwood, linux-kernel
Axel,
On Thu, Sep 11, 2014 at 3:21 AM, Axel Lin <axel.lin@ingics.com> wrote:
> Also remove non-informative comment.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/rk808-regulator.c | 26 --------------------------
> 1 file changed, 26 deletions(-)
Seems reasonable to me.
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-09-13 15:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-11 10:21 [PATCH 1/2] regulator: rk808: Remove unused variables Axel Lin
2014-09-11 10:22 ` [PATCH 2/2] regulator: rk808: Fix missing of_node_put Axel Lin
2014-09-12 22:28 ` Doug Anderson
2014-09-12 13:53 ` [PATCH 1/2] regulator: rk808: Remove unused variables Mark Brown
2014-09-12 22:20 ` Doug Anderson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.