mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/1] iio: accel: bmc150: use common definition for regmap conf
@ 2016-03-28 17:22 Irina Tirdea
  2016-03-28 17:41 ` kbuild test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Irina Tirdea @ 2016-03-28 17:22 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio
  Cc: linux-kernel, Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald,
	Markus Pargmann, Irina Tirdea

bmc150_i2c_regmap_conf is defined three times (in bmc150-accel-core.c,
bmc150-accel-i2c.c and and bmc150-accel-spi.c), although the
definition is the same.

Use one common definition for bmc150_i2c_regmap_conf in all
included files.

Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
---

Changes from v1:
  - instead of removing the unused definition from the core,
share it between the i2c and spi files
  - renamed the subject line from "iio: accel: bmc150: remove
unused definition" to better reflect the new change

 drivers/iio/accel/bmc150-accel-core.c | 3 ++-
 drivers/iio/accel/bmc150-accel-i2c.c  | 5 -----
 drivers/iio/accel/bmc150-accel-spi.c  | 6 ------
 drivers/iio/accel/bmc150-accel.h      | 1 +
 4 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index f3d096f..14d0ee6 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -246,11 +246,12 @@ static const struct {
 				       {500000, BMC150_ACCEL_SLEEP_500_MS},
 				       {1000000, BMC150_ACCEL_SLEEP_1_SEC} };
 
-static const struct regmap_config bmc150_i2c_regmap_conf = {
+const struct regmap_config bmc150_i2c_regmap_conf = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.max_register = 0x3f,
 };
+EXPORT_SYMBOL_GPL(bmc150_i2c_regmap_conf);
 
 static int bmc150_accel_set_mode(struct bmc150_accel_data *data,
 				 enum bmc150_power_modes mode,
diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
index b41404b..4852ecb 100644
--- a/drivers/iio/accel/bmc150-accel-i2c.c
+++ b/drivers/iio/accel/bmc150-accel-i2c.c
@@ -28,11 +28,6 @@
 
 #include "bmc150-accel.h"
 
-static const struct regmap_config bmc150_i2c_regmap_conf = {
-	.reg_bits = 8,
-	.val_bits = 8,
-};
-
 static int bmc150_accel_probe(struct i2c_client *client,
 			      const struct i2c_device_id *id)
 {
diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c
index 16b66f2..e89f460 100644
--- a/drivers/iio/accel/bmc150-accel-spi.c
+++ b/drivers/iio/accel/bmc150-accel-spi.c
@@ -25,12 +25,6 @@
 
 #include "bmc150-accel.h"
 
-static const struct regmap_config bmc150_spi_regmap_conf = {
-	.reg_bits = 8,
-	.val_bits = 8,
-	.max_register = 0x3f,
-};
-
 static int bmc150_accel_probe(struct spi_device *spi)
 {
 	struct regmap *regmap;
diff --git a/drivers/iio/accel/bmc150-accel.h b/drivers/iio/accel/bmc150-accel.h
index ba03359..f2fe611 100644
--- a/drivers/iio/accel/bmc150-accel.h
+++ b/drivers/iio/accel/bmc150-accel.h
@@ -16,5 +16,6 @@ int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,
 			    const char *name, bool block_supported);
 int bmc150_accel_core_remove(struct device *dev);
 extern const struct dev_pm_ops bmc150_accel_pm_ops;
+extern const struct regmap_config bmc150_i2c_regmap_conf;
 
 #endif  /* _BMC150_ACCEL_H_ */
-- 
1.9.1

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

* Re: [PATCH v2 1/1] iio: accel: bmc150: use common definition for regmap conf
  2016-03-28 17:22 [PATCH v2 1/1] iio: accel: bmc150: use common definition for regmap conf Irina Tirdea
@ 2016-03-28 17:41 ` kbuild test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2016-03-28 17:41 UTC (permalink / raw)
  To: Irina Tirdea
  Cc: kbuild-all, Jonathan Cameron, linux-iio, linux-kernel,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald,
	Markus Pargmann, Irina Tirdea

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

Hi Irina,

[auto build test ERROR on iio/togreg]
[also build test ERROR on v4.6-rc1 next-20160327]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Irina-Tirdea/iio-accel-bmc150-use-common-definition-for-regmap-conf/20160329-012449
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: xtensa-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All error/warnings (new ones prefixed by >>):

   In file included from drivers/iio/accel/bmc150-accel-spi.c:23:0:
   drivers/iio/accel/bmc150-accel-spi.c: In function 'bmc150_accel_probe':
>> drivers/iio/accel/bmc150-accel-spi.c:33:38: error: 'bmc150_spi_regmap_conf' undeclared (first use in this function)
     regmap = devm_regmap_init_spi(spi, &bmc150_spi_regmap_conf);
                                         ^
   include/linux/regmap.h:436:6: note: in definition of macro '__regmap_lockdep_wrapper'
      fn(__VA_ARGS__, &_key,     \
         ^
>> drivers/iio/accel/bmc150-accel-spi.c:33:11: note: in expansion of macro 'devm_regmap_init_spi'
     regmap = devm_regmap_init_spi(spi, &bmc150_spi_regmap_conf);
              ^
   drivers/iio/accel/bmc150-accel-spi.c:33:38: note: each undeclared identifier is reported only once for each function it appears in
     regmap = devm_regmap_init_spi(spi, &bmc150_spi_regmap_conf);
                                         ^
   include/linux/regmap.h:436:6: note: in definition of macro '__regmap_lockdep_wrapper'
      fn(__VA_ARGS__, &_key,     \
         ^
>> drivers/iio/accel/bmc150-accel-spi.c:33:11: note: in expansion of macro 'devm_regmap_init_spi'
     regmap = devm_regmap_init_spi(spi, &bmc150_spi_regmap_conf);
              ^

vim +/bmc150_spi_regmap_conf +33 drivers/iio/accel/bmc150-accel-spi.c

f9ab96e2 Markus Pargmann 2015-09-21  17   */
f9ab96e2 Markus Pargmann 2015-09-21  18  
f9ab96e2 Markus Pargmann 2015-09-21  19  #include <linux/device.h>
f9ab96e2 Markus Pargmann 2015-09-21  20  #include <linux/mod_devicetable.h>
f9ab96e2 Markus Pargmann 2015-09-21  21  #include <linux/module.h>
f9ab96e2 Markus Pargmann 2015-09-21  22  #include <linux/acpi.h>
f9ab96e2 Markus Pargmann 2015-09-21 @23  #include <linux/regmap.h>
f9ab96e2 Markus Pargmann 2015-09-21  24  #include <linux/spi/spi.h>
f9ab96e2 Markus Pargmann 2015-09-21  25  
f9ab96e2 Markus Pargmann 2015-09-21  26  #include "bmc150-accel.h"
f9ab96e2 Markus Pargmann 2015-09-21  27  
f9ab96e2 Markus Pargmann 2015-09-21  28  static int bmc150_accel_probe(struct spi_device *spi)
f9ab96e2 Markus Pargmann 2015-09-21  29  {
f9ab96e2 Markus Pargmann 2015-09-21  30  	struct regmap *regmap;
f9ab96e2 Markus Pargmann 2015-09-21  31  	const struct spi_device_id *id = spi_get_device_id(spi);
f9ab96e2 Markus Pargmann 2015-09-21  32  
f9ab96e2 Markus Pargmann 2015-09-21 @33  	regmap = devm_regmap_init_spi(spi, &bmc150_spi_regmap_conf);
f9ab96e2 Markus Pargmann 2015-09-21  34  	if (IS_ERR(regmap)) {
f9ab96e2 Markus Pargmann 2015-09-21  35  		dev_err(&spi->dev, "Failed to initialize spi regmap\n");
f9ab96e2 Markus Pargmann 2015-09-21  36  		return PTR_ERR(regmap);

:::::: The code at line 33 was first introduced by commit
:::::: f9ab96e212808123fbd9072d580a59194e5cd410 iio: bmc150: Add SPI driver

:::::: TO: Markus Pargmann <mpa@pengutronix.de>
:::::: CC: Jonathan Cameron <jic23@kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 44140 bytes --]

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

end of thread, other threads:[~2016-03-28 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-28 17:22 [PATCH v2 1/1] iio: accel: bmc150: use common definition for regmap conf Irina Tirdea
2016-03-28 17:41 ` kbuild test robot

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®