Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1676903ybb; Sat, 4 Apr 2020 09:47:07 -0700 (PDT) X-Google-Smtp-Source: APiQypLwCcRRE4XV758wSH0/OWNPfQqmwALml1zIZi4xytcVGOwYIBsUIE58Xje4jcS/HSFut/HG X-Received: by 2002:a9d:2963:: with SMTP id d90mr10390737otb.149.1586018827350; Sat, 04 Apr 2020 09:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586018827; cv=none; d=google.com; s=arc-20160816; b=SIc7HlV9sF5XYxqwgabzSxKeFGKf7ZvkA/hwm7X5YwlW9+03xkMb46wo2+PvhjtXk/ zR0aB2Y3FiDA7mBzqkShdinGNICxpfes/iOQ8/uMS+UAnKREO4TaNGlYVK9jcKRSVal4 rz/4RpJnHMx2C9d+61gmZQbL7f8915StBBBAe+E5mftJ+S9YEGAjPFP4TTVVW9UUmulp A7K1+nJvEb44xAR3tQtSNc0s0Hd7kqJI70A+nt6VcYJUmpKhYa1ZEYrfoYtdOZr2V4Mq DEoYHe3lbV/7kigtHQlH/wha8CBO+DHOUVwlPa87nmOLMWhlmrcTAynw26se3/iulQ7F Znjw== 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=5OhWRi5yZtbFNJMYkrXr5u0saVK15MasuDdiW+BLRBE=; b=lB57uQmuo+hXRLR9Nt7UdtRuo+SrmlY4qKPI0VRNHzV0clM2pBFCFX2zvEYg2hhTHW L+R6IaZMz67ulExhbgAN4Xodtu4KdO1ET9Qw3YSzFHFZUVl9rlMOWSG4Vb3qFKLzfleU W84wBo6B0104UMJUwhfhil55C/cCzUlRcSTLaLON6FNCgh9uEVC/Z6aH/67paKJ3sAqS I6crwS+swooa7WTRN7/DULF89o/GDm7lLrq+qjkRTzoE3K+/bEYdNSPKlE035jPR580t etsQHyiG+3F9IHXsfDNZIJPWf/RqW1ggOaBkqdKRNE9Pn5zD8pXEuiyLcZgrfe07fsXI 58Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Chu2MnaG; 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 y16si5345877oie.225.2020.04.04.09.46.54; Sat, 04 Apr 2020 09:47:07 -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=Chu2MnaG; 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 S1726287AbgDDQq3 (ORCPT + 99 others); Sat, 4 Apr 2020 12:46:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:55904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbgDDQq2 (ORCPT ); Sat, 4 Apr 2020 12:46:28 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (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 04114206D4; Sat, 4 Apr 2020 16:46:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586018788; bh=YQG4A/GOYNd5Jp5QAvFtVV//iwhK5hZrHteGmAX+ZTI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Chu2MnaGnccIKwDG6kMVXAqNdd6Up23J/BnZNgW1WTxLB+vGzeu/1vBFuH3d2Wmj7 IiRhxh4zmcsdEsCdrEvbHRbieYyKMuZxwYVXbpc65XAPVWIJiTU1LqoAUdFekAGqVI 79he8aXsBtMixMTbsEaeIcwT3gzoKlqJ8IPDlwQ0= Date: Sat, 4 Apr 2020 17:46:24 +0100 From: Jonathan Cameron To: Mircea Caprioru Cc: , , , , , Subject: Re: [PATCH] iio: core: Fix handling of 'dB' Message-ID: <20200404174624.0b7f1c80@archlinux> In-Reply-To: <20200401112230.4708-1-mircea.caprioru@analog.com> References: <20200401112230.4708-1-mircea.caprioru@analog.com> X-Mailer: Claws Mail 3.17.5 (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 Wed, 1 Apr 2020 14:22:30 +0300 Mircea Caprioru wrote: > This patch fixes the call to iio_str_to_fixpoint when using 'dB' sufix. > Before this the scale_db was not used when parsing the string written to > the attribute and it failed with invalid value. > > Fixes: b8528224741b ("iio: core: Handle 'dB' suffix in core") > Signed-off-by: Mircea Caprioru Gah, I guess this messed up around the introduction of the character handling. Applied to the fixes-togreg branch of iio.git. Thanks, Jonathan > --- > drivers/iio/industrialio-core.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c > index 157d95a24faa..7da9cd2a2b58 100644 > --- a/drivers/iio/industrialio-core.c > +++ b/drivers/iio/industrialio-core.c > @@ -909,14 +909,11 @@ static ssize_t iio_write_channel_info(struct device *dev, > return -EINVAL; > integer = ch; > } else { > - ret = iio_str_to_fixpoint(buf, fract_mult, &integer, &fract); > + ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract, > + scale_db); > if (ret) > return ret; > } > - ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract, > - scale_db); > - if (ret) > - return ret; > > ret = indio_dev->info->write_raw(indio_dev, this_attr->c, > integer, fract, this_attr->address);