Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH 1/3] regulator: bcm590xx: Make the modalias matches the driver name

28 views
Skip to first unread message

Axel Lin

unread,
Mar 13, 2014, 10:00:02 PM3/13/14
to
Signed-off-by: Axel Lin <axel...@ingics.com>
---
drivers/regulator/bcm590xx-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c
index e6b2e8e..d12d6d6 100644
--- a/drivers/regulator/bcm590xx-regulator.c
+++ b/drivers/regulator/bcm590xx-regulator.c
@@ -410,4 +410,4 @@ module_platform_driver(bcm590xx_regulator_driver);
MODULE_AUTHOR("Matt Porter <mpo...@linaro.org>");
MODULE_DESCRIPTION("BCM590xx voltage regulator driver");
MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:bcm590xx-regulator");
+MODULE_ALIAS("platform:bcm590xx-vregs");
--
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Axel Lin

unread,
Mar 13, 2014, 10:00:02 PM3/13/14
to
The **rdev of 'struct bcm590xx_reg' isn't used anywhere in the driver so
remove it.

Signed-off-by: Axel Lin <axel...@ingics.com>
---
drivers/regulator/bcm590xx-regulator.c | 10 ----------
1 file changed, 10 deletions(-)

diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c
index d12d6d6..ab08ca7 100644
--- a/drivers/regulator/bcm590xx-regulator.c
+++ b/drivers/regulator/bcm590xx-regulator.c
@@ -153,7 +153,6 @@ static struct bcm590xx_info bcm590xx_regs[] = {
struct bcm590xx_reg {
struct regulator_desc *desc;
struct bcm590xx *mfd;
- struct regulator_dev **rdev;
struct bcm590xx_info **info;
};

@@ -334,13 +333,6 @@ static int bcm590xx_probe(struct platform_device *pdev)
return -ENOMEM;
}

- pmu->rdev = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
- sizeof(struct regulator_dev *), GFP_KERNEL);
- if (!pmu->rdev) {
- dev_err(&pdev->dev, "Memory alloc fails for rdev\n");
- return -ENOMEM;
- }
-
info = bcm590xx_regs;

for (i = 0; i < BCM590XX_NUM_REGS; i++, info++) {
@@ -391,8 +383,6 @@ static int bcm590xx_probe(struct platform_device *pdev)
pdev->name);
return PTR_ERR(rdev);
}
-
- pmu->rdev[i] = rdev;
}

return 0;

Axel Lin

unread,
Mar 13, 2014, 10:10:04 PM3/13/14
to
BCM590XX_NUM_REGS is known in compile time.
Use array to save desc and *info makes the code simpler.

Signed-off-by: Axel Lin <axel...@ingics.com>
---
drivers/regulator/bcm590xx-regulator.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c
index ab08ca7..fe21855 100644
--- a/drivers/regulator/bcm590xx-regulator.c
+++ b/drivers/regulator/bcm590xx-regulator.c
@@ -151,9 +151,9 @@ static struct bcm590xx_info bcm590xx_regs[] = {
};

struct bcm590xx_reg {
- struct regulator_desc *desc;
+ struct regulator_desc desc[BCM590XX_NUM_REGS];
struct bcm590xx *mfd;
- struct bcm590xx_info **info;
+ struct bcm590xx_info *info[BCM590XX_NUM_REGS];
};

static int bcm590xx_get_vsel_register(int id)
@@ -319,20 +319,6 @@ static int bcm590xx_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, pmu);

- pmu->desc = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
- sizeof(struct regulator_desc), GFP_KERNEL);
- if (!pmu->desc) {
- dev_err(&pdev->dev, "Memory alloc fails for desc\n");
- return -ENOMEM;
- }
-
- pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
- sizeof(struct bcm590xx_info *), GFP_KERNEL);
- if (!pmu->info) {
- dev_err(&pdev->dev, "Memory alloc fails for info\n");
- return -ENOMEM;
- }
-
info = bcm590xx_regs;

for (i = 0; i < BCM590XX_NUM_REGS; i++, info++) {

Matt Porter

unread,
Mar 20, 2014, 11:30:02 AM3/20/14
to
On Fri, Mar 14, 2014 at 09:59:07AM +0800, Axel Lin wrote:
> The **rdev of 'struct bcm590xx_reg' isn't used anywhere in the driver so
> remove it.
>
> Signed-off-by: Axel Lin <axel...@ingics.com>
> ---
> drivers/regulator/bcm590xx-regulator.c | 10 ----------
> 1 file changed, 10 deletions(-)

Looks good, thanks for catching this.

Acked-by: Matt Porter <mpo...@linaro.org>

Matt Porter

unread,
Mar 20, 2014, 11:50:01 AM3/20/14
to
On Fri, Mar 14, 2014 at 10:00:28AM +0800, Axel Lin wrote:
> BCM590XX_NUM_REGS is known in compile time.
> Use array to save desc and *info makes the code simpler.
>
> Signed-off-by: Axel Lin <axel...@ingics.com>

Well, ok. It was coded for dynamic allocation because I'm starting to
work on BCM59054 support, which is similar but different. The actual
regulators are different but, due to luck, the total number is the
same between 59056 and 59054...so this can still work for the moment.
However, another 590xx part does have a different number of regulators
so I'm not sure this is worth doing when we know we'll go back to
dynamic allocation in the future.

-Matt

Axel Lin

unread,
Mar 20, 2014, 9:00:03 PM3/20/14
to
2014-03-20 23:42 GMT+08:00 Matt Porter <mpo...@linaro.org>:
> On Fri, Mar 14, 2014 at 10:00:28AM +0800, Axel Lin wrote:
>> BCM590XX_NUM_REGS is known in compile time.
>> Use array to save desc and *info makes the code simpler.
>>
>> Signed-off-by: Axel Lin <axel...@ingics.com>
>
> Well, ok. It was coded for dynamic allocation because I'm starting to
> work on BCM59054 support, which is similar but different. The actual
> regulators are different but, due to luck, the total number is the
> same between 59056 and 59054...so this can still work for the moment.
> However, another 590xx part does have a different number of regulators
> so I'm not sure this is worth doing when we know we'll go back to
> dynamic allocation in the future.

Then it' ok to keep the code as is, just drop this patch.

Regards,
Axel

Mark Brown

unread,
Mar 21, 2014, 2:20:01 PM3/21/14
to
On Fri, Mar 14, 2014 at 09:57:54AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel...@ingics.com>

Applied, thanks.
signature.asc

Mark Brown

unread,
Mar 21, 2014, 2:20:01 PM3/21/14
to
On Fri, Mar 14, 2014 at 09:59:07AM +0800, Axel Lin wrote:
> The **rdev of 'struct bcm590xx_reg' isn't used anywhere in the driver so
> remove it.

Applied, thanks.
signature.asc
0 new messages