Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1901396yba; Sun, 7 Apr 2019 03:29:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB0k6dbsXIdbzuZ0++/QIxsAyNwgaX15bkV/R42kUcxPi9+cv5z8DA7IxgXmWhBPBiopvR X-Received: by 2002:a62:ae13:: with SMTP id q19mr23584270pff.152.1554632945654; Sun, 07 Apr 2019 03:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554632945; cv=none; d=google.com; s=arc-20160816; b=llOoj4n4hCtveCI0zJayk56R85Cpfsp0iiEKcYjeFBC0YOf8Pgc8I9SLi7DhCMM8E6 eXiP3pH0Xa5b+ysuvE6DWcEUNzbu24qpeac1xvHeTubAZSFwU9pIq/+VvCJq3qW5OU5Q Spp5KMjL6fSWFNRGJtvlnO9TgN7yoiPF/9gWCcWKVtCOyQPeeu2eksQmyE6WsIy0P5cu +sRH8Lygpo6lDkIGgTDzh1yw/bNNRxL3H2YaZSGiZAt9FaWHAcK1zFusc89ttYSwpwEW ds8N7sa6lWzqXZVOsGqGkQHv9iN7OBYBoI/K7IDvTgi3qYPP4lTHEBxQJVrdz09zlcgW fAng== 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=/BxHCOGfKrAvGrG36rqJg0ee0Az2LXs61SngHQMJ4UA=; b=B51NJniq8USpVb4zfXuG30i/s8VMP02b0xhyQG/XW5adSh9cx5a29ulqpvPqTraNMW N59/RMRf8dt8dWn/qmoOXWNDtHnqAOCfDUfVoaUeU+ypsT6bwsYlaGAxGQPrBpouy6Wt Bz2V+NfAdSsbB43/ZaEwn3sYwXmLvhE+pmD9NMNdBmSD/kUbI80uFpo5cAZlwY2Ioa7h FXZBR3IU6gxSoK6JwgJtuWwN4UMo+UK4IG6ItLAD19UKurJpekscDs/HdbzvN6z7w4vJ Uogj1ixvKAA6O2iuxvC7UPDGTOiyWe+3yih1bOOtpl0q8AHAy0YOC9brExQPXNuG/MHs r1qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CDQWL8kB; 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 y9si15121345pgh.55.2019.04.07.03.28.47; Sun, 07 Apr 2019 03:29:05 -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=CDQWL8kB; 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 S1726282AbfDGK2K (ORCPT + 99 others); Sun, 7 Apr 2019 06:28:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:47080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbfDGK2K (ORCPT ); Sun, 7 Apr 2019 06:28: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 1A3CD213F2; Sun, 7 Apr 2019 10:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554632889; bh=8hD8WxkDAJm856q9Xl0cW+WxSrX0fTKFNfrBhRVZDak=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CDQWL8kBhhTHhj7rL4TSVPMI8N9g9kfPEUC7+QmJAeiSILfZXfgUXJoxFuX42MwzS /Yb1lN4MaqciG/rew2VXX58E+dw+ozaclmAeUAba/2M3V2Vqi/F+NJxak1ZDfnIzy9 J8MuY3Z+CxQptDmddJDx84EhC9hqjL1qJIyttGNU= Date: Sun, 7 Apr 2019 11:28:03 +0100 From: Jonathan Cameron To: Tomer Maimon Cc: gregkh@linuxfoundation.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, yuenn@google.com, venture@google.com, brendanhiggins@google.com, avifishman70@gmail.com, joel@jms.id.au, linux-iio@vger.kernel.org, openbmc@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] iio: adc: modify NPCM ADC read reference voltage Message-ID: <20190407112803.5de7b4c2@archlinux> In-Reply-To: <20190407081928.72250-1-tmaimon77@gmail.com> References: <20190407081928.72250-1-tmaimon77@gmail.com> 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 Sun, 7 Apr 2019 11:19:28 +0300 Tomer Maimon wrote: > Checking if regulator is valid before reading > NPCM ADC regulator voltage to avoid system crash > in a case the regulator is not valid. > > Signed-off-by: Tomer Maimon Good catch. Applied to the fixes-togreg branch of iio.git and marked for stable. Thanks, Jonathan > --- > drivers/iio/adc/npcm_adc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/npcm_adc.c b/drivers/iio/adc/npcm_adc.c > index 9e25bbec9c70..193b3b81de4d 100644 > --- a/drivers/iio/adc/npcm_adc.c > +++ b/drivers/iio/adc/npcm_adc.c > @@ -149,7 +149,7 @@ static int npcm_adc_read_raw(struct iio_dev *indio_dev, > } > return IIO_VAL_INT; > case IIO_CHAN_INFO_SCALE: > - if (info->vref) { > + if (!IS_ERR(info->vref)) { > vref_uv = regulator_get_voltage(info->vref); > *val = vref_uv / 1000; > } else {