Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1726567img; Sat, 23 Mar 2019 10:29:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxybUXVyAenNEaS23toDv49LlTFy+3/IFYFXwXXZN3MjZ+2S7Aiiu2xcbzwPvn62l2q8AJa X-Received: by 2002:a62:e904:: with SMTP id j4mr15301392pfh.174.1553362166764; Sat, 23 Mar 2019 10:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553362166; cv=none; d=google.com; s=arc-20160816; b=YHyGaDjLo6PSnErYTM4tMGkSTYH/HOUfDvdvlBegbKXDsU5Pgx1muU6633OxAQVclq 3lBMoxjTVzOYA7loBs6oomjj5uGgaaCJUuVad7vH+m1iyuTsYC69b2pAhC988FhhA8jw UevE3pVmLeWUepcYmJORug87TGzc/R/VdHVVNjWc2K4BSaeyTbMKxgzC2524SBoAc0FQ CSegRa2H0OQXloC04BjhHpg7YZtgRFzljAxDElzREK4S4ugyN6qxLuMW753B4Tdj+c9H stf/9B/Hmm99S1Ompdt8tUA4uwCvGeK2hagj68LJAJdk5j+tqG8lZfy/zEfc+OUtlEB4 nf4g== 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:cc:to:from; bh=7GTwt90bg2hKfZ3tGtU2VG+RnBhgSpe7DymsjCwIDy4=; b=IC6l9kNv/MmdJ0t2U67ja0PTlCJ8vJm3deTnEm32HNihmOC5xPabncUDtB3dzvtExu 1f6i4MaRb9T/MBkv9DCL7ysjejqpDDaucW7VEXZF/i6kahdIIBdPq68/vkEAt0HFfm0/ YHw8U4UACuEqFbEi6cHcQ/9DBnDC4qcUPoREbzntuv06gZKzNSf2eM01A6y1TBVQ+p9l 6ypxlqsnMvGVGdEce6h3CQgofl0ww77Rwl4RV9bUs9uLHWTkCkPiCB1psMBHrfcdxgFX 2YvFt68nhvCdoV8R/gLFG0NWPPudku5dhFOeq7Auh+Tig+6eoSqxPGcaLrhlLJYy3fs/ hNug== 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 e2si10275572pln.45.2019.03.23.10.29.12; Sat, 23 Mar 2019 10:29:26 -0700 (PDT) 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 S1728053AbfCWR2b (ORCPT + 99 others); Sat, 23 Mar 2019 13:28:31 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:41839 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727945AbfCWR2a (ORCPT ); Sat, 23 Mar 2019 13:28:30 -0400 Received: from pc.localdomain (unknown [91.192.165.7]) (Authenticated sender: contact@artur-rojek.eu) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 7334D200008; Sat, 23 Mar 2019 17:28:27 +0000 (UTC) From: Artur Rojek To: Sebastian Reichel , Jonathan Cameron , Rob Herring , Mark Rutland Cc: linux-pm@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Artur Rojek Subject: [PATCH v2 2/4] iio: inkern: Convert iio_read_avail_channel_raw into a wrapper Date: Sat, 23 Mar 2019 18:28:07 +0100 Message-Id: <20190323172809.14407-2-contact@artur-rojek.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190323172809.14407-1-contact@artur-rojek.eu> References: <20190323172809.14407-1-contact@artur-rojek.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert "iio_read_avail_channel_raw" over to a wrapper around "iio_read_avail_channel_attribute". With the introduction of "iio_read_avail_channel_attribute", the necessity of having a separate call to read raw channel values became redundant. Signed-off-by: Artur Rojek --- Changes: v2: new patch drivers/iio/inkern.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index f19dbde3c945..4a5eff3f18bc 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c @@ -759,16 +759,8 @@ int iio_read_avail_channel_raw(struct iio_channel *chan, int ret; int type; - mutex_lock(&chan->indio_dev->info_exist_lock); - if (!chan->indio_dev->info) { - ret = -ENODEV; - goto err_unlock; - } - - ret = iio_channel_read_avail(chan, - vals, &type, length, IIO_CHAN_INFO_RAW); -err_unlock: - mutex_unlock(&chan->indio_dev->info_exist_lock); + ret = iio_read_avail_channel_attribute(chan, vals, &type, length, + IIO_CHAN_INFO_RAW); if (ret >= 0 && type != IIO_VAL_INT) /* raw values are assumed to be IIO_VAL_INT */ -- 2.21.0