Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp574132imd; Sat, 3 Nov 2018 06:13:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5fbqjKCbN4CbrbD6j5VKkIpOa5dkBllLaCu57iR0hd6NziTlrmjjBi5KZK7CQ6O5tscdGSF X-Received: by 2002:a17:902:b692:: with SMTP id c18-v6mr15328135pls.191.1541250789240; Sat, 03 Nov 2018 06:13:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541250789; cv=none; d=google.com; s=arc-20160816; b=AeeLm4QT5AGYHGfDgDOeBO8mfHyur5pcICsv+1sqChfnTmswwotsaNOknMejweCC75 vN65ULXY6ZGoWtsIeE1RKQtyTEx/cYULMPk0gdMWJd5AIEPb+C4JX21g7tobh7tyeJsz 5P7KSzw9FaaohbW1Ge3Rf5o62sJT4SxufXQjvCGaM+Sozexi9oqWgvKbuFsNgBZDuy53 OhMejG/oYT9Ey1/xHY6HTkQrJG0lHtBTAcmYg+tlVUAOe89ExmQP2bo4pRjGlsZGiHFO ft6D6EV5WStkr6sIclgGtUBIeO5BSog4EEvasPRTtzAaEC9bSExXpz4lEvExQ4s0lF+N ePxA== 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=224dGYTAPQQb5FJDwHpTleWAYTX4sUPKDP+9sDt5YmQ=; b=kp8FjaGl36JEeIzYAAnm80Yd/uBn3W6J885tCA8cxqmLUQIavbndu/RYH7icjUFNkI 4CIaHIJvCs4r4xEnpIbFBDPGX0aGIAIk/9db6SMpGukrUVyr8hQb9Dy6gRcrJSUt2eoT DLkc6mZKcGsEY2ubDgVH5SH1UaEmrlAcbiX6XnjNJ7ZTkGVAw9v78HZ0HJFF5ufO0n+p V5P4l6n+fTSJvI/6MC85AJrZqvu4VKuoCoO1BDZ0WA9bxFdUuurDoreCMx6qi+pEVUUd rWWnV4NOcR5/MoIGtaz9sExynE53v8vLQhdi9BkZ6qglu7J92dqdqWecyysxdcZwoLEQ 6o3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U2CHIEDf; 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 u91-v6si26675681plb.180.2018.11.03.06.12.54; Sat, 03 Nov 2018 06:13:09 -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=U2CHIEDf; 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 S1728689AbeKCWWK (ORCPT + 99 others); Sat, 3 Nov 2018 18:22:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbeKCWWK (ORCPT ); Sat, 3 Nov 2018 18:22:10 -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 EAE8E2082E; Sat, 3 Nov 2018 13:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541250652; bh=oUkojuTHqsnCHnPMmDc+mo53D1MYvLemB6y3jAsS7ow=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U2CHIEDf0PlKwmjqjo1AvDiHBqFseJok7KA3zS2VNktSdbkNXo+sBcvnFjMX235/p DyznsxbLB631HYEzMd0Eq99E3urtqP88xTl7Kq8wiToYnt2zTbwqFtF+aFA4MYOyaZ pOKiSJi1CBXl7Mu9ZRHAvO2S2ACOFhF44Sa1RPhc= Date: Sat, 3 Nov 2018 13:10:47 +0000 From: Jonathan Cameron To: "Ardelean, Alexandru" Cc: "lars@metafoo.de" , "knaack.h@gmx.de" , "Hennerich, Michael" , "renatogeh@gmail.com" , "giuliano.belinassi@usp.br" , "pmeerw@pmeerw.net" , "gregkh@linuxfoundation.org" , "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" , "devel@driverdev.osuosl.org" , "kernel-usp@googlegroups.com" Subject: Re: [PATCH v3 3/3] staging: iio: ad7780: remove unnecessary stashed voltage value Message-ID: <20181103131047.235ee9cf@archlinux> In-Reply-To: <8e33078437ba3153305c5d31aba54412a786a9bb.camel@analog.com> References: <8e33078437ba3153305c5d31aba54412a786a9bb.camel@analog.com> X-Mailer: Claws Mail 3.17.1 (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 Thu, 1 Nov 2018 15:28:19 +0000 "Ardelean, Alexandru" wrote: > On Thu, 2018-11-01 at 11:43 -0300, Renato Lui Geh wrote: > > This patch removes the unnecessary field int_vref_mv in ad7780_state > > referring to the device's voltage. > > > > Signed-off-by: Renato Lui Geh > > --- > > Changes in v3: > > - removed unnecessary int_vref_mv from ad7780_state > > > > drivers/staging/iio/adc/ad7780.c | 5 +---- > > 1 file changed, 1 insertion(+), 4 deletions(-) > > > > diff --git a/drivers/staging/iio/adc/ad7780.c > > b/drivers/staging/iio/adc/ad7780.c > > index f2a11e9424cd..f250370efcf7 100644 > > --- a/drivers/staging/iio/adc/ad7780.c > > +++ b/drivers/staging/iio/adc/ad7780.c > > @@ -42,7 +42,6 @@ struct ad7780_state { > > struct regulator *reg; > > struct gpio_desc *powerdown_gpio; > > unsigned int gain; > > - u16 int_vref_mv; > > > > struct ad_sigma_delta sd; > > }; > > @@ -190,9 +189,7 @@ static int ad7780_probe(struct spi_device *spi) > > st->chip_info = > > &ad7780_chip_info_tbl[spi_get_device_id(spi)->driver_data]; > > > > - if (voltage_uv) > > - st->int_vref_mv = voltage_uv / 1000; > > - else > > + if (!voltage_uv) > > dev_warn(&spi->dev, "Reference voltage unspecified\n"); > > I think you could remove this altogether, and also remove the entire > `voltage_uv = regulator_get_voltage(st->reg);` assignment. > > It doesn't make much sense to read the voltage here, since it won't be used > in the probe part anymore. > Absolutely agree on this. There is no point in reading here at all. Jonathan > > > > spi_set_drvdata(spi, indio_dev);