Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535562

[PATCH 02/19] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Brian Masney <masneyb@onstation.org>
Newsgroups linux.kernel
Subject [PATCH 02/19] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()
Date Sun, 04 Dec 2016 03:30:01 +0100
Message-ID <sKuIV-194-15@gated-at.bofh.it> (permalink)
References <sKuIV-194-3@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=simple/simple; d=onstation.org; s=default; t=1480817990; bh=tgWhWFmRwn2M9oy5MeB7/4Aaam7iLNK9EQEpdrXbfr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lKQ8gnU4+P1q7G2igVwFZ1Uaap+JTXgiQhSfKKNSlzKaSWTSFdZTPSNeI/p3YKdNw bLy5LqSmNAM9HzQz1Id8Abv/24nGCzBdFn4FM8I3iSrX6KsawAjvCWPRDX8yOC6Q/Q R+pM7KYsyQUBPn0+Gu16G/bJTyUuzYRfYFJ1KgQI=
X-Mailer git-send-email 2.7.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-kernel@vger.kernel.org, ldewangan@nvidia.com
X-Original-Date Sat, 3 Dec 2016 21:19:26 -0500
X-Original-Message-ID <1480817983-32359-3-git-send-email-masneyb@onstation.org>
X-Original-References <1480817983-32359-1-git-send-email-masneyb@onstation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1535562

Show key headers only | View raw


isl29028_enable_proximity() has a boolean argument named enable. This
function is only called once and the enable flag is set to true in that
call. This patch removes the enable parameter from that function.

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

diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
index 4e35d00..c8e234d 100644
--- a/drivers/staging/iio/light/isl29028.c
+++ b/drivers/staging/iio/light/isl29028.c
@@ -93,15 +93,13 @@ static int isl29028_set_proxim_sampling(struct isl29028_chip *chip,
 				  sel << ISL29028_CONF_PROX_SLP_SH);
 }
 
-static int isl29028_enable_proximity(struct isl29028_chip *chip, bool enable)
+static int isl29028_enable_proximity(struct isl29028_chip *chip)
 {
 	int ret;
-	int val = 0;
 
-	if (enable)
-		val = ISL29028_CONF_PROX_EN;
 	ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
-				 ISL29028_CONF_PROX_EN_MASK, val);
+				 ISL29028_CONF_PROX_EN_MASK,
+				 ISL29028_CONF_PROX_EN);
 	if (ret < 0)
 		return ret;
 
@@ -215,7 +213,7 @@ static int isl29028_proxim_get(struct isl29028_chip *chip, int *prox_data)
 	int ret;
 
 	if (!chip->enable_prox) {
-		ret = isl29028_enable_proximity(chip, true);
+		ret = isl29028_enable_proximity(chip);
 		if (ret < 0)
 			return ret;
 		chip->enable_prox = true;
-- 
2.7.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 02/19] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity() Brian Masney <masneyb@onstation.org> - 2016-12-04 03:30 +0100

csiph-web