From patchwork Fri May 4 02:53:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Masney X-Patchwork-Id: 10379733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1589560327 for ; Fri, 4 May 2018 02:54:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02E152923B for ; Fri, 4 May 2018 02:54:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EABB529243; Fri, 4 May 2018 02:54:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FAFA2923B for ; Fri, 4 May 2018 02:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751339AbeEDCye (ORCPT ); Thu, 3 May 2018 22:54:34 -0400 Received: from onstation.org ([52.200.56.107]:45180 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbeEDCxa (ORCPT ); Thu, 3 May 2018 22:53:30 -0400 Received: from xilitla.hsd1.wv.comcast.net (c-98-236-77-125.hsd1.wv.comcast.net [98.236.77.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: masneyb) by onstation.org (Postfix) with ESMTPSA id 8626A1FBE; Fri, 4 May 2018 02:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=onstation.org; s=default; t=1525402409; bh=Nh/gieODlOZ7XEnABBgYzdTy915JvD6HBd5vjgJMK8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVER6x6+ZecrVFEP/jnXAcMfIorEDKRpaSn6nLzQHF2oim89i6iMomLclPplANb4R 8jd5kOzksVjRo3+Z8erIY3zd5rUmvelXbWaJ4C/q7lxHwwPRxcwSluyffJkqcDL99b oCQaW4mjDSel3aOwK6GS5tTjAC0p98ohtjGIAIsU= From: Brian Masney To: jic23@kernel.org, linux-iio@vger.kernel.org Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-kernel@vger.kernel.org, drew.paterson@ams.com Subject: [PATCH v2 08/11] staging: iio: tsl2x7x: add device ids for code readability Date: Thu, 3 May 2018 22:53:16 -0400 Message-Id: <20180504025319.28953-9-masneyb@onstation.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180504025319.28953-1-masneyb@onstation.org> References: <20180504025319.28953-1-masneyb@onstation.org> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds the device IDs to the device_channel_config array to improve code readability. Signed-off-by: Brian Masney --- 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)