Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2660843ybl; Mon, 20 Jan 2020 07:06:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxljWB15bC/vbot76gEXrjqy/dYcNlo479qg4yr22+i5T17tg8ZptD6EYBcDi9LBQP5Wib1 X-Received: by 2002:a05:6830:158:: with SMTP id j24mr16692190otp.316.1579532791588; Mon, 20 Jan 2020 07:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579532791; cv=none; d=google.com; s=arc-20160816; b=iDi893qu63kckoxUcp96NTEGOW0FgYBpsj5fbap43iNHrBVSAUR59r22OkJAcbBCbe z68A1wmS0A7IMtb0VSPcc/bu4KUIxuP3CN2XIX2Vy8PHy1Nr5jwm6HPT4ukL3gahJCxn pY3tEKk+ktftIYbqC6zmv4qSpJOjbPg1ZBwJk7Sv7oCwWd7d2heX6HL3rvNjuffpr2YJ Vt/5J1ZNsVcR04A18FgeORNkTUsFIntSDVhjPD5hddUEo+Fu8Nw7/9LQ9dEINtwOsmYf HHxAMB0VHRdEpUORXjSNFqO87Lzzv6798JhcFlIpP5r4i1APp/pF7svSGz3Br/0ZJitX Rngg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=FNiBrGR95ZfieUIKFny8yXT8vtw+UkMs6N5KIFZkwY8=; b=Z/hJo9RmDasKRWyAhYQP7lVjBC1cjVip4K4A/nWqV2Y8c0n7j7Vxcu7130iZLlDfKE b3SlqvhOP5SN4gGmhT+ImKvowl9MwrnepG9zbO2aulwlt7EaILlhe3dsPH2tpN1Jci2M vtJD4rOHlkXJBBDlg5v4B3Nkrm2us4O7cnDp7GVgvkvZzeEnk5bkrJAhhJYAOAWLhItY Qxz1Hool2eHfG2baiBiLAo1bI8Lu9HEMUVICmyLBKIgN/C1eto1UHSo2MZFKPbF87vIM mb/OHIVRvqVmKQjDPb2r+ZNri0ySls1jsR19vK+j9q2b57UMw+6f+hpbT1Gp/Q56cVRo Fxrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si18190449otp.200.2020.01.20.07.06.18; Mon, 20 Jan 2020 07:06:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728901AbgATPFS (ORCPT + 99 others); Mon, 20 Jan 2020 10:05:18 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:53846 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbgATPFQ (ORCPT ); Mon, 20 Jan 2020 10:05:16 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id EB472FB03; Mon, 20 Jan 2020 16:05:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9Ka0lCVAhWGn; Mon, 20 Jan 2020 16:05:12 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 55768404A3; Mon, 20 Jan 2020 16:01:24 +0100 (CET) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: Tomas Novotny , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , "Angus Ainslie (Purism)" , =?UTF-8?q?Guido=20G=C3=BCnther?= , Marco Felsch , Thomas Gleixner , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] iio: vcnl4000: Use a single return when getting IIO_CHAN_INFO_RAW Date: Mon, 20 Jan 2020 16:01:23 +0100 Message-Id: <8ed27a3935cd0e5324bd397a33dfa429b4746719.1579531608.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This will be useful when introducing runtime pm. Signed-off-by: Guido Günther --- drivers/iio/light/vcnl4000.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index b0e241aaefb4..8f198383626b 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -335,17 +335,18 @@ static int vcnl4000_read_raw(struct iio_dev *indio_dev, switch (chan->type) { case IIO_LIGHT: ret = data->chip_spec->measure_light(data, val); - if (ret < 0) - return ret; - return IIO_VAL_INT; + if (!ret) + ret = IIO_VAL_INT; + break; case IIO_PROXIMITY: ret = data->chip_spec->measure_proximity(data, val); - if (ret < 0) - return ret; - return IIO_VAL_INT; + if (!ret) + ret = IIO_VAL_INT; + break; default: - return -EINVAL; + ret = -EINVAL; } + return ret; case IIO_CHAN_INFO_SCALE: if (chan->type != IIO_LIGHT) return -EINVAL; -- 2.23.0