Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp730910imd; Sat, 3 Nov 2018 09:07:05 -0700 (PDT) X-Google-Smtp-Source: AJdET5cGydXkJUxsxxfqrdI57OognCLgyvStHXpWZM/BOwe7+lHUkSQUISZxZ/5o2RRvtzRew2hX X-Received: by 2002:a65:4646:: with SMTP id k6mr14375525pgr.153.1541261225641; Sat, 03 Nov 2018 09:07:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541261225; cv=none; d=google.com; s=arc-20160816; b=UZvlQ6H4gJ2A0flCh4kO+1vgg7vfGBrieTlBMMoMqbzWdjgRUl/k1K1uVfEnniqva4 fbOpD8rnI2x4OXrM/JIG9XdnTdXSbdKvm/DB+CAAKuKdUae6I6JZjYf+vyT+DZ9/6BKf kvVFStFTeLsD70XZWvyOx/cCdZQo0BjkC5yQYQMCjzqfQup8HZEw7ZWpyU7MeVulBSAe X/EuPaRhqBIhGmHBiv7H0fPZNG1wGBSyPk00KOUneqQWgsTxeVxahJv9iMWM4kLN1LxF NSiM76XriVGgpyz+1spt79853+RwbH9T/6CQtRWZr5kGxfDRDjRwPp79eEDKUqRKSpet 3+3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=GeKwfLs38klEKXjhoDuszkgAjwsJgbnD3io++Ugyuv4=; b=Oj2EiAeifTnSd+5DKqNlXIaJwXPm8aPvsIfAwCIxMq7Xq0aIpk6um236oG1ELMH6GN 5+FQPD2fgbawFcWIAYn4zlVpERUihwnTujSQOfw7GtHn7Ek4/4H8fzHK1qCQP3Wcl348 nhqS6NL/7YptSVHZ5CwsILRIr3XkvampKkJHBnQIJ5X3IpNpLkmvHWVbclQp5uZ/Zl3F Ty6kjANjLIWZWT4EA3UnMc0gvW1WfEry1w6CQ4wHjNEFVopB2kBxe9+qqAlcMS9xjRkV RXQp7f8QnUfgjPI/E13HY+uRfaXvomaed3eLARDuk7asHMJTfr3lJfvhVASbV9YQZINS 2cmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="tCRNm/WY"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4-v6si38175084pgn.176.2018.11.03.09.06.51; Sat, 03 Nov 2018 09:07: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=@gmail.com header.s=20161025 header.b="tCRNm/WY"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728484AbeKDBSI (ORCPT + 99 others); Sat, 3 Nov 2018 21:18:08 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:42503 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeKDBSI (ORCPT ); Sat, 3 Nov 2018 21:18:08 -0400 Received: by mail-qk1-f193.google.com with SMTP id u68so7982194qkg.9; Sat, 03 Nov 2018 09:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GeKwfLs38klEKXjhoDuszkgAjwsJgbnD3io++Ugyuv4=; b=tCRNm/WYv7iYW44isNbADjn33rr2QtMjFDD6NJFVZtMAiTAvbs9+3oZ0BzMbTdOYP2 iTfjYE78G4ylRmwogFYGDt8cAbFp+tIwkcySOwO6CQ5X6Fz/jL4UhYrP+rUdVcOSNCNa HBkSjRrNsjGyaPGVNXWS1ChvBF8LRLNRTSrtfxslGNGrlz9/WO4aAnwqc1Lsf6rPbcBk 6yU8PxxrJokcaC0EiZ+DD1hDl8WdtEpHS0wqIvxYsvyuxkdEgurYIFMv8h0DsTY7/azD /PDE0vBjQ3R6cUoYY1Yrhj4S+QNgdPw6yicok/2Kms2OETMH2Q1xcei79AC+P7E8gHpw AUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=GeKwfLs38klEKXjhoDuszkgAjwsJgbnD3io++Ugyuv4=; b=XkU5oDlt9RwXqw72vf5SjOvir3sEuJDdBbeOEHBrrc2Pxd02jqb+7++/KUHeRFoRKM JTf+tXCX/bHLxSFdQgkMQudtGT1yVUZAgqeuhnhCUimNjcoYEXkQxfMQ99nbKNHLqNYz svbHsKK1TTOsziQLkbHn+pM+x5bS6a3Bo5gw75Gd2Gb4n8QungCLS+hgdZBUw1nMSA0i AI1ms5avEUqCt8nmGY6PPJVj09GUHbvy+37xjxGA6fnpcRfJqj9u5DLBmt0QsjTtTjrJ K9OfNkQ+P36RrXT0tmRuM3KCHtGXux1lUEwT61fHZ9Ar1jv6fPlGC5zSK2vW6GtOMJNw 2rcw== X-Gm-Message-State: AGRZ1gKRBTXMuug9PRKGmoNps1HN6Klo8FAxYx0hPOsK8ZvCrAQ9b3iw JTGaV8U87fZMDzASPltNnYU= X-Received: by 2002:ac8:6b8a:: with SMTP id z10mr4963094qts.248.1541261184874; Sat, 03 Nov 2018 09:06:24 -0700 (PDT) Received: from renatolg ([186.220.24.65]) by smtp.gmail.com with ESMTPSA id a68sm33106016qkj.63.2018.11.03.09.06.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 03 Nov 2018 09:06:24 -0700 (PDT) From: Renato Lui Geh X-Google-Original-From: Renato Lui Geh Date: Sat, 3 Nov 2018 13:06:19 -0300 To: Jonathan Cameron Cc: "Ardelean, Alexandru" , "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 2/3] staging: iio: ad7780: update voltage on read Message-ID: <20181103160618.wioq7jbdh4z5yqdw@renatolg> References: <1bc4bdf6342d4bc0c2fea17fb3bcd79fabf0e1d1.1541082656.git.renatogeh@gmail.com> <20181103131002.7956a08b@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20181103131002.7956a08b@archlinux> User-Agent: NeoMutt/20180716 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:20:55 +0000 "Ardelean, Alexandru" wrote: > > This looks wrong. > I admit this was done in the same way in the probe function, but that looks > a bit wrong as well. > > Typically, the return value of `regulator_get_voltage()` would get checked > with: > > ret = regulator_get_voltage(st->reg); > if (ret < 0) > return ret; > *val = ret / 1000; > > So, negative values are errors and zero & positive values are valid voltage > values. I see. So -EINVAL is only used when sent the wrong info type?