Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2429583img; Sun, 24 Mar 2019 08:29:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8j9HTRgvK8owuruQSGuEUitU0nsvwtId1jdwlKdBfgdhw/ydSFJfwTR3W2ovmhjd33d0U X-Received: by 2002:a65:625a:: with SMTP id q26mr18928903pgv.61.1553441357724; Sun, 24 Mar 2019 08:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553441357; cv=none; d=google.com; s=arc-20160816; b=dilP+Q4nvM2g4ixxBtQu8EtjXmmc1NscBEY8W9iWI6AGNe6HOePQxqMFNtRQk6K6NT ENPlVpnjckdwTJLZz7/LycWDh4K95e8sYfBI1AuFoiUIr8/rJCNWFVPWkeHxWE5ow9/q ZskSkRGPeep4OBfN4Xxw961N9U2sm+MLO4+bmL5VX5jc62Qshm2yD4Evx20ucaqg5NpG 5fNo36wjd40kFvg2V1y7zwYhz+6gi6ilefXof2FBv9s5Nl042KDlYvIecpJKjuuwcerj 2S/eTneiJDHHw5jNs94GwdsU00CubTyg9NbMetfZn8HQDWtTYZ5tWagvVo4pPwSt+ElQ RGyQ== 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:subject:cc:to:from:date :dkim-signature; bh=nZzQULGbIf0hXFw+TVLRbszEzScegS+Qx/lC1dtMHNg=; b=MYM7VZJ0ws+8BFg/5lrFRA1etD88wNuQQyRaHzlW/k/iiNbCKuNEIWUCaJqh3hZcxm /k1z0fzhi71GekQsFaJ3JKAxeaWCycwRwu8WC5nsDhamACTll/Desk8qqCuPgH37t0up mDR64GC/HvUY+IsObN5tq0NLZhUMgVvGszYvi9h5dncDlfrbl9zTSZGBVCnShVVTOE46 Jccy2iC1aC/nSu9AIBZ0tvbEnhhkG6sxTJk+/hoOXufdE+EcDjVwJ8zygafV+Zx99Lfs 6KNKf171z2wQJ5uOOmqev7W0J2QKzBMZi76lckDw2RmNDeMQBJEcgjcWkPjE5OIpd32K TBiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lHFslGF+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si12266528plk.279.2019.03.24.08.29.02; Sun, 24 Mar 2019 08:29:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lHFslGF+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728782AbfCXP15 (ORCPT + 99 others); Sun, 24 Mar 2019 11:27:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:59180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbfCXP14 (ORCPT ); Sun, 24 Mar 2019 11:27:56 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 455E020700; Sun, 24 Mar 2019 15:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553441276; bh=wmMFp47rXKkrxSNQ39fudLAGZy1dhilPCEU94iny3Lo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lHFslGF+2IZPcFf1/f/mHKwkaSv5K+BqGROyFejzutS4O7zD1URW5zuhpU2MEGbud 6mQ7maGEwn9VgZ2C+iVjAHDSIM/4VsoNG4z9ORsuDEfwTpQGOfGRwSsINfiTuhn9S2 EkB5cKI1qQB/IawNgaFz6Kb7lF28qdlWX8l3YsB0= Date: Sun, 24 Mar 2019 15:27:50 +0000 From: Jonathan Cameron To: Artur Rojek Cc: Sebastian Reichel , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: Re: [PATCH v2 2/4] iio: inkern: Convert iio_read_avail_channel_raw into a wrapper Message-ID: <20190324152750.43edf737@archlinux> In-Reply-To: <20190323172809.14407-2-contact@artur-rojek.eu> References: <20190323172809.14407-1-contact@artur-rojek.eu> <20190323172809.14407-2-contact@artur-rojek.eu> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 23 Mar 2019 18:28:07 +0100 Artur Rojek wrote: > 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 Acked-by: Jonathan Cameron > --- > > 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 */