diff mbox

[v2,08/11] staging: iio: tsl2x7x: add device ids for code readability

Message ID 20180504025319.28953-9-masneyb@onstation.org (mailing list archive)
State New, archived
Headers show

Commit Message

Brian Masney May 4, 2018, 2:53 a.m. UTC
This patch adds the device IDs to the device_channel_config array to
improve code readability.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2x7x.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Jonathan Cameron May 6, 2018, 6:26 p.m. UTC | #1
On Thu,  3 May 2018 22:53:16 -0400
Brian Masney <masneyb@onstation.org> wrote:

> This patch adds the device IDs to the device_channel_config array to
> improve code readability.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/light/tsl2x7x.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c
> index e3e37501829f..39de5e60fd33 100644
> --- a/drivers/staging/iio/light/tsl2x7x.c
> +++ b/drivers/staging/iio/light/tsl2x7x.c
> @@ -273,16 +273,16 @@ enum {
>  };
>  
>  static const u8 device_channel_config[] = {
> -	ALS,
> -	PRX,
> -	PRX,
> -	ALSPRX,
> -	ALSPRX,
> -	ALS,
> -	PRX2,
> -	PRX2,
> -	ALSPRX2,
> -	ALSPRX2
> +	[tsl2571] = ALS,
> +	[tsl2671] = PRX,
> +	[tmd2671] = PRX,
> +	[tsl2771] = ALSPRX,
> +	[tmd2771] = ALSPRX,
> +	[tsl2572] = ALS,
> +	[tsl2672] = PRX2,
> +	[tmd2672] = PRX2,
> +	[tsl2772] = ALSPRX2,
> +	[tmd2772] = ALSPRX2
>  };
>  
>  static int tsl2x7x_read_status(struct tsl2X7X_chip *chip)

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c
index e3e37501829f..39de5e60fd33 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -273,16 +273,16 @@  enum {
 };
 
 static const u8 device_channel_config[] = {
-	ALS,
-	PRX,
-	PRX,
-	ALSPRX,
-	ALSPRX,
-	ALS,
-	PRX2,
-	PRX2,
-	ALSPRX2,
-	ALSPRX2
+	[tsl2571] = ALS,
+	[tsl2671] = PRX,
+	[tmd2671] = PRX,
+	[tsl2771] = ALSPRX,
+	[tmd2771] = ALSPRX,
+	[tsl2572] = ALS,
+	[tsl2672] = PRX2,
+	[tmd2672] = PRX2,
+	[tsl2772] = ALSPRX2,
+	[tmd2772] = ALSPRX2
 };
 
 static int tsl2x7x_read_status(struct tsl2X7X_chip *chip)