diff mbox series

[2/3] iio: dac: ltc2632: drop some duplicated data

Message ID 20200130131549.1170-2-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series [1/3] dt-bindings: iio: ltc2632: expand for ltc2636 support | expand

Commit Message

Uwe Kleine-König Jan. 30, 2020, 1:15 p.m. UTC
The channel data for ltc2632l12 and ltc2632h12 are identical. So there
is no gain in using two different (but identical) channel descriptions.
The only side effect of this change is some memory savings.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/iio/dac/ltc2632.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

Comments

Jonathan Cameron Feb. 6, 2020, 10:54 a.m. UTC | #1
On Thu, 30 Jan 2020 14:15:48 +0100
Uwe Kleine-König         <u.kleine-koenig@pengutronix.de> wrote:

> The channel data for ltc2632l12 and ltc2632h12 are identical. So there
> is no gain in using two different (but identical) channel descriptions.
> The only side effect of this change is some memory savings.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Applied.
> ---
>  drivers/iio/dac/ltc2632.c | 22 +++++++++-------------
>  1 file changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
> index 643d1ce956ce..7ab92e178496 100644
> --- a/drivers/iio/dac/ltc2632.c
> +++ b/drivers/iio/dac/ltc2632.c
> @@ -192,37 +192,33 @@ static const struct iio_chan_spec_ext_info ltc2632_ext_info[] = {
>  		LTC2632_CHANNEL(1, _bits), \
>  	}
>  
> -static DECLARE_LTC2632_CHANNELS(ltc2632l12, 12);
> -static DECLARE_LTC2632_CHANNELS(ltc2632l10, 10);
> -static DECLARE_LTC2632_CHANNELS(ltc2632l8, 8);
> -
> -static DECLARE_LTC2632_CHANNELS(ltc2632h12, 12);
> -static DECLARE_LTC2632_CHANNELS(ltc2632h10, 10);
> -static DECLARE_LTC2632_CHANNELS(ltc2632h8, 8);
> +static DECLARE_LTC2632_CHANNELS(ltc2632x12, 12);
> +static DECLARE_LTC2632_CHANNELS(ltc2632x10, 10);
> +static DECLARE_LTC2632_CHANNELS(ltc2632x8, 8);
>  
>  static const struct ltc2632_chip_info ltc2632_chip_info_tbl[] = {
>  	[ID_LTC2632L12] = {
> -		.channels	= ltc2632l12_channels,
> +		.channels	= ltc2632x12_channels,
>  		.vref_mv	= 2500,
>  	},
>  	[ID_LTC2632L10] = {
> -		.channels	= ltc2632l10_channels,
> +		.channels	= ltc2632x10_channels,
>  		.vref_mv	= 2500,
>  	},
>  	[ID_LTC2632L8] =  {
> -		.channels	= ltc2632l8_channels,
> +		.channels	= ltc2632x8_channels,
>  		.vref_mv	= 2500,
>  	},
>  	[ID_LTC2632H12] = {
> -		.channels	= ltc2632h12_channels,
> +		.channels	= ltc2632x12_channels,
>  		.vref_mv	= 4096,
>  	},
>  	[ID_LTC2632H10] = {
> -		.channels	= ltc2632h10_channels,
> +		.channels	= ltc2632x10_channels,
>  		.vref_mv	= 4096,
>  	},
>  	[ID_LTC2632H8] =  {
> -		.channels	= ltc2632h8_channels,
> +		.channels	= ltc2632x8_channels,
>  		.vref_mv	= 4096,
>  	},
>  };
diff mbox series

Patch

diff --git a/drivers/iio/dac/ltc2632.c b/drivers/iio/dac/ltc2632.c
index 643d1ce956ce..7ab92e178496 100644
--- a/drivers/iio/dac/ltc2632.c
+++ b/drivers/iio/dac/ltc2632.c
@@ -192,37 +192,33 @@  static const struct iio_chan_spec_ext_info ltc2632_ext_info[] = {
 		LTC2632_CHANNEL(1, _bits), \
 	}
 
-static DECLARE_LTC2632_CHANNELS(ltc2632l12, 12);
-static DECLARE_LTC2632_CHANNELS(ltc2632l10, 10);
-static DECLARE_LTC2632_CHANNELS(ltc2632l8, 8);
-
-static DECLARE_LTC2632_CHANNELS(ltc2632h12, 12);
-static DECLARE_LTC2632_CHANNELS(ltc2632h10, 10);
-static DECLARE_LTC2632_CHANNELS(ltc2632h8, 8);
+static DECLARE_LTC2632_CHANNELS(ltc2632x12, 12);
+static DECLARE_LTC2632_CHANNELS(ltc2632x10, 10);
+static DECLARE_LTC2632_CHANNELS(ltc2632x8, 8);
 
 static const struct ltc2632_chip_info ltc2632_chip_info_tbl[] = {
 	[ID_LTC2632L12] = {
-		.channels	= ltc2632l12_channels,
+		.channels	= ltc2632x12_channels,
 		.vref_mv	= 2500,
 	},
 	[ID_LTC2632L10] = {
-		.channels	= ltc2632l10_channels,
+		.channels	= ltc2632x10_channels,
 		.vref_mv	= 2500,
 	},
 	[ID_LTC2632L8] =  {
-		.channels	= ltc2632l8_channels,
+		.channels	= ltc2632x8_channels,
 		.vref_mv	= 2500,
 	},
 	[ID_LTC2632H12] = {
-		.channels	= ltc2632h12_channels,
+		.channels	= ltc2632x12_channels,
 		.vref_mv	= 4096,
 	},
 	[ID_LTC2632H10] = {
-		.channels	= ltc2632h10_channels,
+		.channels	= ltc2632x10_channels,
 		.vref_mv	= 4096,
 	},
 	[ID_LTC2632H8] =  {
-		.channels	= ltc2632h8_channels,
+		.channels	= ltc2632x8_channels,
 		.vref_mv	= 4096,
 	},
 };