public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C
@ 2013-07-29  4:08 Axel Lin
  2013-07-29  4:09 ` [PATCH 2/2] regulator: pfuze100: Use i2c_[set|get]_clientdata Axel Lin
  2013-07-29  5:50 ` [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2013-07-29  4:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: Robin Gong, Liam Girdwood, linux-kernel

This fixes below build errors:

  CC [M]  drivers/regulator/pfuze100-regulator.o
drivers/regulator/pfuze100-regulator.c:342:21: error: variable 'pfuze_regmap_config' has initializer but incomplete type
drivers/regulator/pfuze100-regulator.c:343:2: error: unknown field 'reg_bits' specified in initializer
drivers/regulator/pfuze100-regulator.c:343:2: warning: excess elements in struct initializer [enabled by default]
drivers/regulator/pfuze100-regulator.c:343:2: warning: (near initialization for 'pfuze_regmap_config') [enabled by default]
drivers/regulator/pfuze100-regulator.c:344:2: error: unknown field 'val_bits' specified in initializer
drivers/regulator/pfuze100-regulator.c:344:2: warning: excess elements in struct initializer [enabled by default]
drivers/regulator/pfuze100-regulator.c:344:2: warning: (near initialization for 'pfuze_regmap_config') [enabled by default]
drivers/regulator/pfuze100-regulator.c:345:2: error: unknown field 'max_register' specified in initializer
drivers/regulator/pfuze100-regulator.c:345:2: warning: excess elements in struct initializer [enabled by default]
drivers/regulator/pfuze100-regulator.c:345:2: warning: (near initialization for 'pfuze_regmap_config') [enabled by default]
drivers/regulator/pfuze100-regulator.c:346:2: error: unknown field 'cache_type' specified in initializer
drivers/regulator/pfuze100-regulator.c:346:2: warning: excess elements in struct initializer [enabled by default]
drivers/regulator/pfuze100-regulator.c:346:2: warning: (near initialization for 'pfuze_regmap_config') [enabled by default]
drivers/regulator/pfuze100-regulator.c: In function 'pfuze100_regulator_probe':
drivers/regulator/pfuze100-regulator.c:370:2: error: implicit declaration of function 'devm_regmap_init_i2c' [-Werror=implicit-function-declaration]
drivers/regulator/pfuze100-regulator.c:370:21: warning: assignment makes pointer from integer without a cast [enabled by default]
cc1: some warnings being treated as errors
make[2]: *** [drivers/regulator/pfuze100-regulator.o] Error 1
make[1]: *** [drivers/regulator] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index b96815d..fe77cd9 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -368,6 +368,7 @@ config REGULATOR_PCF50633
 config REGULATOR_PFUZE100
 	tristate "Support regulators on Freescale PFUZE100 PMIC"
 	depends on I2C
+	select REGMAP_I2C
 	help
 	  Say y here to support the regulators found on the Freescale PFUZE100
 	  PMIC.
-- 
1.8.1.2




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] regulator: pfuze100: Use i2c_[set|get]_clientdata
  2013-07-29  4:08 [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C Axel Lin
@ 2013-07-29  4:09 ` Axel Lin
  2013-07-29  5:50 ` [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Axel Lin @ 2013-07-29  4:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: Robin Gong, Liam Girdwood, linux-kernel

Since this is a i2c driver, use i2c_[set|get]_clientdata instead of
dev_[set|get]_drvdata.

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

diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index e2f9dcf..cd136ff 100644
--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -360,7 +360,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
 	if (!pfuze_chip)
 		return -ENOMEM;
 
-	dev_set_drvdata(&client->dev, pfuze_chip);
+	i2c_set_clientdata(client, pfuze_chip);
 
 	memcpy(pfuze_chip->regulator_descs, pfuze100_regulators,
 		sizeof(pfuze_chip->regulator_descs));
@@ -429,7 +429,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client,
 static int pfuze100_regulator_remove(struct i2c_client *client)
 {
 	int i;
-	struct pfuze_chip *pfuze_chip = dev_get_drvdata(&client->dev);
+	struct pfuze_chip *pfuze_chip = i2c_get_clientdata(client);
 
 	for (i = 0; i < PFUZE100_MAX_REGULATOR; i++)
 		regulator_unregister(pfuze_chip->regulators[i]);
-- 
1.8.1.2




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C
  2013-07-29  4:08 [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C Axel Lin
  2013-07-29  4:09 ` [PATCH 2/2] regulator: pfuze100: Use i2c_[set|get]_clientdata Axel Lin
@ 2013-07-29  5:50 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2013-07-29  5:50 UTC (permalink / raw)
  To: Axel Lin; +Cc: Robin Gong, Liam Girdwood, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 109 bytes --]

On Mon, Jul 29, 2013 at 12:08:01PM +0800, Axel Lin wrote:
> This fixes below build errors:

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-29  5:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-29  4:08 [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C Axel Lin
2013-07-29  4:09 ` [PATCH 2/2] regulator: pfuze100: Use i2c_[set|get]_clientdata Axel Lin
2013-07-29  5:50 ` [PATCH 1/2] regulator: pfuze100: REGULATOR_PFUZE100 needs to select REGMAP_I2C Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox