From patchwork Wed Mar 21 10:29:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Masney X-Patchwork-Id: 10299105 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 AD1A760349 for ; Wed, 21 Mar 2018 10:31:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CE032973F for ; Wed, 21 Mar 2018 10:31:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9154129783; Wed, 21 Mar 2018 10:31:44 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 2CF952973F for ; Wed, 21 Mar 2018 10:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751666AbeCUK30 (ORCPT ); Wed, 21 Mar 2018 06:29:26 -0400 Received: from onstation.org ([52.200.56.107]:47244 "EHLO onstation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbeCUK3Y (ORCPT ); Wed, 21 Mar 2018 06:29:24 -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 AE2B5583; Wed, 21 Mar 2018 10:29:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=onstation.org; s=default; t=1521628163; bh=bPQ4lqvMw9gIJzN4LBLHZn7ej3TxaiBj2BFeLOQLUmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bhWI3gqLDW0251t9r4xQ35xjQwz40AZ2b16cE87l9gwG8R/2+AV6a9ADebCYFll7y RULnAIISlKDPch44TZrYSJIAx7gqgZi5TCuX7ajUCHL+/TapT9S63kp6Q/L6CCzVYK LoXkN22q1dN6ArQCZY0JtO8csspe3YmAB+IYy7Yo= 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, Jon.Brenner@ams.com Subject: [PATCH 01/11] staging: iio: tsl2x7x: remove unnecessary code Date: Wed, 21 Mar 2018 06:29:02 -0400 Message-Id: <20180321102912.5130-2-masneyb@onstation.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180321102912.5130-1-masneyb@onstation.org> References: <20180321102912.5130-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 As a follow up to the work in commit a0722d05a195 ("staging: iio: tsl2x7x: convert mutex_trylock() to mutex_lock()"), this patch removes the unnecessary calls to tsl2x7x_get_prox() and tsl2x7x_get_lux() in tsl2x7x_event_handler(). Previously, these functions were locked with mutex_trylock(), but that is no longer the case. This patch also removes a comment that is no longer relevant about returning the last sample. Signed-off-by: Brian Masney --- drivers/staging/iio/light/tsl2x7x.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/iio/light/tsl2x7x.c b/drivers/staging/iio/light/tsl2x7x.c index 82681300e106..82cf9d853b18 100644 --- a/drivers/staging/iio/light/tsl2x7x.c +++ b/drivers/staging/iio/light/tsl2x7x.c @@ -1430,7 +1430,6 @@ static irqreturn_t tsl2x7x_event_handler(int irq, void *private) /* What type of interrupt do we need to process */ if (ret & TSL2X7X_STA_PRX_INTR) { - tsl2x7x_get_prox(indio_dev); /* freshen data for ABI */ iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_PROXIMITY, 0, @@ -1440,7 +1439,6 @@ static irqreturn_t tsl2x7x_event_handler(int irq, void *private) } if (ret & TSL2X7X_STA_ALS_INTR) { - tsl2x7x_get_lux(indio_dev); /* freshen data for ABI */ iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_LIGHT, 0, @@ -1745,10 +1743,6 @@ static int tsl2x7x_probe(struct i2c_client *clientp, return ret; } - /* - * ALS and PROX functions can be invoked via user space poll - * or H/W interrupt. If busy return last sample. - */ mutex_init(&chip->als_mutex); mutex_init(&chip->prox_mutex);