Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp300126pxb; Mon, 16 Aug 2021 05:51:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqgO0e6Ji6geGVVtLP7AvTei2dIYLhBvOmRTXjQcHLUxLxi8zGPUtOgtRtbV9UPWGDczOB X-Received: by 2002:a17:906:c0cd:: with SMTP id bn13mr16155534ejb.251.1629118265306; Mon, 16 Aug 2021 05:51:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629118265; cv=none; d=google.com; s=arc-20160816; b=Fdo2iTGUJRlcB/At3ND/85hNG3Hry8lEUh0dJo0wmflkyWJRcPLyNhhIqeDmASDkiH QXuaPJ17lj0xxeDwCMMIJTvx2IIi7nsrSywNv0qo8sqG2vBj/m6QvGN9aP4+dUVrSdR6 BhitVS5s7g91yjOT+FZXfJGoN89gu58wITegX5NUU8j2MCEj2u4yIEqTa8ufe2Tb1JSk NL0MUCEa3m+RukTUYrcbt2pD+QsNA9/tFlzqK/u46imhgVSzjKuV6QB5ETzZ9utjWPEo dpOukF3gx7CL6z0gJluYxc68BcrWQ9X1dphuqmHh6Rb7f5cIkSmt0ZeXc2GScc1j2l+D 2VpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fy2isYPKNPiV5shXC0pHBU+VcJN04Q1fGssTZF6jyrk=; b=YcFpKEweucA4s47w7GlsUl8tUVA4GORTx7Z2ierso2qOKoquouEcvBeT+vIVtRHfyY IK4cLbQ/OPyBGePNxI4KfcM4pRkh3Ka8MNRaIsSpH97TLuCzFdtolKqr31LyPfyqsmSW T0ROZ9W0y5VJW5YpRi2HBKAyjNrZtWs+pE/5kuClUbrdNH56kqb3elOy6UPDGtTEzou0 6YPhh37WfaiZjQ0Osg+S4CVha9PY7npSzxk2HfktFh1I3gfWM3L8wgPKhX8dfvIe9yEP E3QerIJ499SiqsMfV6GpzsUe6AV2yCp24oNIETpzAix+cR+x+Br2OXmUiQHtERR7O16m fbDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dbgyiLbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id r16si10458290edq.576.2021.08.16.05.50.41; Mon, 16 Aug 2021 05:51:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dbgyiLbU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230209AbhHPMtl (ORCPT + 99 others); Mon, 16 Aug 2021 08:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbhHPMtk (ORCPT ); Mon, 16 Aug 2021 08:49:40 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8909AC061764; Mon, 16 Aug 2021 05:49:08 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id mq2-20020a17090b3802b0290178911d298bso27455064pjb.1; Mon, 16 Aug 2021 05:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fy2isYPKNPiV5shXC0pHBU+VcJN04Q1fGssTZF6jyrk=; b=dbgyiLbUICxgXBHTpnPAt/qsKESjlH/GBJ5TU7nhRGV6hU3DTxWOTZYXjVLe6V0LOw Dy5an50QuHgAsakguL9U4ZBtazFIOR++CnKTFqv4riOyEDkF9ulw4+gyQSQC2VKERLTL pY7zB8ORh5dlqbAOIym3VEBlvcua2JM0gIUmuyxst6vgBfbDaQESHW6DNjybfifgsXf5 lDXOZD7hV6xVp4uZod0U+x4SRKyNDnumXP7YuRH3pPBF5WUYsw+oX8jD3xMRRdkUh3xq wuXCGi1NAz8Q2egjbTe1ppJ4daHst0QJjkwiyLAKGPXSH+3Latwvcs25zzB7dzjdypEE KELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fy2isYPKNPiV5shXC0pHBU+VcJN04Q1fGssTZF6jyrk=; b=B8BkGsQzmhDbELiYJO0GPW2Vy2o/eCmYHYGkRRI9VK+b1lz8alK4J3zBW3h9RAmxEF zjvLmntlBpqLT6RmX/ez7GrkzfeodfBhl/JDTiWXit6fUppek0SCaVyU+AHb3QwVLUXP 7FmwkftYxnkOKQBsNj8HkXPiltEy7419qfyXkvUZgu79U8Rr5ALwf1Ss61+/6aySwRC0 3dBHfYKIaTqjklc5SjMKoPlkvlbbIQIJ2kR2j5a2Cj883jCxEdRAL7f8IQPzndV0Bsb9 8sh5jm3gFRTcZlbNqjJdOyAFWZIDq2BnTpAT2zIZEZaSm5lnz7wJTd19wsTHyxmAda+d 9o7g== X-Gm-Message-State: AOAM530vlzj9VyV2t+yoa4YW8mGbGp7L/rNqzuJ5tjplxLpwc8Ba8qUM FfSNjvsRdWXsyv3tD7TO4mjSv+hqxARq+AH7Kag= X-Received: by 2002:a17:902:e786:b029:12d:2a7:365f with SMTP id cp6-20020a170902e786b029012d02a7365fmr13247410plb.21.1629118148043; Mon, 16 Aug 2021 05:49:08 -0700 (PDT) MIME-Version: 1.0 References: <20210815213309.2847711-1-liambeguin@gmail.com> <20210815213309.2847711-4-liambeguin@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 16 Aug 2021 15:48:28 +0300 Message-ID: Subject: Re: [PATCH v6 3/5] iio: adc: ad7949: add vref selection support To: Liam Beguin Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Charles-Antoine Couret , =?UTF-8?B?TnVubyBTw6E=?= , Linux Kernel Mailing List , linux-iio , devicetree , Rob Herring Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 16, 2021 at 3:39 PM Liam Beguin wrote: > On Mon Aug 16, 2021 at 4:04 AM EDT, Andy Shevchenko wrote: > > On Mon, Aug 16, 2021 at 12:35 AM Liam Beguin > > wrote: ... > > > + tmp = 4096000; > > > + ret = device_property_read_u32(dev, "adi,internal-ref-microvolt", &tmp); > > > > > + if (ret < 0 && ret != -EINVAL) { > > Hi Andy, > > > > > What does this check (second part) is supposed to mean? > > The first part will make it mandatory, is it the goal? > > > > device_property_read_u32() will return -EINVAL if the property isn't > found in the devicetree. > > This checks for errors when the property is defined while keeping it > optional. Don't assign and don't check the error code of the API. As simply as that. > > > + dev_err(dev, "invalid value for adi,internal-ref-microvolt\n"); > > > + return ret; > > > + } -- With Best Regards, Andy Shevchenko