Patchwork regulator: tps51632: Get regulator name from i2c_client

login
register
mail settings
Submitter Mikko Perttunen
Date June 18, 2013, 10:30 a.m.
Message ID <1371551413-12346-1-git-send-email-mperttunen@nvidia.com>
Download mbox | patch
Permalink /patch/252226/
State Awaiting Upstream
Headers show

Comments

Mikko Perttunen - June 18, 2013, 10:30 a.m.
Commit "i2c: core: make it possible to match a pure device tree driver"
changed semantics of the i2c probing for device tree devices.
Device tree probed devices now get a NULL i2c_device_id pointer.
This causes the regulator name to be set to NULL and the regulator
registration to fail.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
---
 drivers/regulator/tps51632-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Mark Brown - June 18, 2013, 11:44 a.m.
On Tue, Jun 18, 2013 at 01:30:13PM +0300, Mikko Perttunen wrote:
> Commit "i2c: core: make it possible to match a pure device tree driver"
> changed semantics of the i2c probing for device tree devices.
> Device tree probed devices now get a NULL i2c_device_id pointer.
> This causes the regulator name to be set to NULL and the regulator
> registration to fail.

Applied, thanks.  Though it does seem like we should just be hard coding
this string anyway...
Wolfram Sang - June 18, 2013, 4 p.m.
On Tue, Jun 18, 2013 at 01:30:13PM +0300, Mikko Perttunen wrote:
> Commit "i2c: core: make it possible to match a pure device tree driver"
> changed semantics of the i2c probing for device tree devices.
> Device tree probed devices now get a NULL i2c_device_id pointer.
> This causes the regulator name to be set to NULL and the regulator
> registration to fail.
> 
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>

The commit in question will be reverted. This patch shouldn't hurt,
though.

Patch

diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c
index 6e67be7..87c37f8 100644
--- a/drivers/regulator/tps51632-regulator.c
+++ b/drivers/regulator/tps51632-regulator.c
@@ -305,7 +305,7 @@  static int tps51632_probe(struct i2c_client *client,
 	}
 
 	tps->dev = &client->dev;
-	tps->desc.name = id->name;
+	tps->desc.name = client->name;
 	tps->desc.id = 0;
 	tps->desc.ramp_delay = TPS51632_DEFAULT_RAMP_DELAY;
 	tps->desc.min_uV = TPS51632_MIN_VOLATGE;