Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1364016 > unrolled thread
| Started by | Irina Tirdea <irina.tirdea@intel.com> |
|---|---|
| First post | 2016-03-24 10:10 +0100 |
| Last post | 2016-03-28 18:10 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 1/1] iio: accel: bmc150: remove unused definition Irina Tirdea <irina.tirdea@intel.com> - 2016-03-24 10:10 +0100
Re: [PATCH 1/1] iio: accel: bmc150: remove unused definition Jonathan Cameron <jic23@kernel.org> - 2016-03-28 12:10 +0200
RE: [PATCH 1/1] iio: accel: bmc150: remove unused definition "Tirdea, Irina" <irina.tirdea@intel.com> - 2016-03-28 18:10 +0200
| From | Irina Tirdea <irina.tirdea@intel.com> |
|---|---|
| Date | 2016-03-24 10:10 +0100 |
| Subject | [PATCH 1/1] iio: accel: bmc150: remove unused definition |
| Message-ID | <rg9rc-lu-13@gated-at.bofh.it> |
bmc150_i2c_regmap_conf is defined in bmc150-accel-core.c, but
never used here. The definition is needed in bmc150-accel-i2c.c,
where it is again defined.
Remove the unnecessary definition of bmc150_i2c_regmap_conf from
bmc150-accel-core.c and update the one from bmc150-accel-i2c.c
to contain all fields.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
---
drivers/iio/accel/bmc150-accel-core.c | 6 ------
drivers/iio/accel/bmc150-accel-i2c.c | 1 +
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
index c73331f7..feff894 100644
--- a/drivers/iio/accel/bmc150-accel-core.c
+++ b/drivers/iio/accel/bmc150-accel-core.c
@@ -246,12 +246,6 @@ static const struct {
{500000, BMC150_ACCEL_SLEEP_500_MS},
{1000000, BMC150_ACCEL_SLEEP_1_SEC} };
-static const struct regmap_config bmc150_i2c_regmap_conf = {
- .reg_bits = 8,
- .val_bits = 8,
- .max_register = 0x3f,
-};
-
static int bmc150_accel_set_mode(struct bmc150_accel_data *data,
enum bmc150_power_modes mode,
int dur_us)
diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
index b41404b..f0969fe 100644
--- a/drivers/iio/accel/bmc150-accel-i2c.c
+++ b/drivers/iio/accel/bmc150-accel-i2c.c
@@ -31,6 +31,7 @@
static const struct regmap_config bmc150_i2c_regmap_conf = {
.reg_bits = 8,
.val_bits = 8,
+ .max_register = 0x3f,
};
static int bmc150_accel_probe(struct i2c_client *client,
--
1.9.1
[toc] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2016-03-28 12:10 +0200 |
| Message-ID | <rhCht-5v5-25@gated-at.bofh.it> |
| In reply to | #1364016 |
On 24/03/16 09:00, Irina Tirdea wrote:
> bmc150_i2c_regmap_conf is defined in bmc150-accel-core.c, but
> never used here. The definition is needed in bmc150-accel-i2c.c,
> where it is again defined.
>
> Remove the unnecessary definition of bmc150_i2c_regmap_conf from
> bmc150-accel-core.c and update the one from bmc150-accel-i2c.c
> to contain all fields.
>
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Silly question. Why isn't it shared between the i2c and spi drivers?
Looks to be the same in both cases (as we'd expect from regmap most
of the time!). I think it would be better to share it.
Jonathan
> ---
> drivers/iio/accel/bmc150-accel-core.c | 6 ------
> drivers/iio/accel/bmc150-accel-i2c.c | 1 +
> 2 files changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
> index c73331f7..feff894 100644
> --- a/drivers/iio/accel/bmc150-accel-core.c
> +++ b/drivers/iio/accel/bmc150-accel-core.c
> @@ -246,12 +246,6 @@ static const struct {
> {500000, BMC150_ACCEL_SLEEP_500_MS},
> {1000000, BMC150_ACCEL_SLEEP_1_SEC} };
>
> -static const struct regmap_config bmc150_i2c_regmap_conf = {
> - .reg_bits = 8,
> - .val_bits = 8,
> - .max_register = 0x3f,
> -};
> -
> static int bmc150_accel_set_mode(struct bmc150_accel_data *data,
> enum bmc150_power_modes mode,
> int dur_us)
> diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c
> index b41404b..f0969fe 100644
> --- a/drivers/iio/accel/bmc150-accel-i2c.c
> +++ b/drivers/iio/accel/bmc150-accel-i2c.c
> @@ -31,6 +31,7 @@
> static const struct regmap_config bmc150_i2c_regmap_conf = {
> .reg_bits = 8,
> .val_bits = 8,
> + .max_register = 0x3f,
> };
>
> static int bmc150_accel_probe(struct i2c_client *client,
>
[toc] | [prev] | [next] | [standalone]
| From | "Tirdea, Irina" <irina.tirdea@intel.com> |
|---|---|
| Date | 2016-03-28 18:10 +0200 |
| Message-ID | <rhHTP-ZO-5@gated-at.bofh.it> |
| In reply to | #1365429 |
> -----Original Message----- > From: Jonathan Cameron [mailto:jic23@kernel.org] > Sent: 28 March, 2016 13:09 > To: Tirdea, Irina; linux-iio@vger.kernel.org > Cc: linux-kernel@vger.kernel.org; Hartmut Knaack; Lars-Peter Clausen; Peter Meerwald; Markus Pargmann > Subject: Re: [PATCH 1/1] iio: accel: bmc150: remove unused definition > > On 24/03/16 09:00, Irina Tirdea wrote: > > bmc150_i2c_regmap_conf is defined in bmc150-accel-core.c, but > > never used here. The definition is needed in bmc150-accel-i2c.c, > > where it is again defined. > > > > Remove the unnecessary definition of bmc150_i2c_regmap_conf from > > bmc150-accel-core.c and update the one from bmc150-accel-i2c.c > > to contain all fields. > > > > Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> > Silly question. Why isn't it shared between the i2c and spi drivers? > Looks to be the same in both cases (as we'd expect from regmap most > of the time!). I think it would be better to share it. > Good point. I'll keep the definition in the core file and share the regmap with the rest. Thanks, Irina
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web