Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2993569pxb; Sun, 29 Aug 2021 09:43:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqpWzjPueeX8oWB+eFno5B077EQpyfJFuJuur72/Wau5idK2TYYAwvBopfpOnG+9kaCNg7 X-Received: by 2002:a17:906:6c1:: with SMTP id v1mr20208225ejb.113.1630255389081; Sun, 29 Aug 2021 09:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630255389; cv=none; d=google.com; s=arc-20160816; b=f4Qao4R/e7mEw+3x5YNwNOl6RbG+XFUGxljeUTrQYTBWPVmuNuGYGKd/mu2wjJvYC2 v8FWdA1ZkeiDezqVze8ykdMIH8dBmmxDeJMvEGzjfcA6NGheNwHJwbaimKo6WOufOvxY eN269W/UoLF521HXyCqQr/4QC65Znv8mHab0SFrGZJ7lu8/X9UffH+DsLxijjq2oC5ei 3ggai9yo6yAiqmRq+u/C2TI4XWwQ0rCHji3xnv4ZocSwEZCWnMVlzkwar3M6MoLFIlkM sbPTZsqG2eIhsJfgSamn+ewqFj4movDnIiSp7OPnnUjx/K/nGwnefM+AiMbzu3+fElun Frzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ji321exc53a4JxTUvbkiptwl4tQt4o11O/DIl8Ea0bw=; b=zaAZ3bhQRvC7ZfiA1gOm67UvJVrJQKqYg/BXV+EzHF8V2SZaA4N3mw72dq6PEn8PkH /J03C4+cxhJLyDa3BObOr8Vo35SSd/lDADtZAz/N803c8SzY6Ly8FehC4kjWlqEwZLQi EAp/EgD0GiwlLN0aln+cxj/UndJbd3LugLfrNNUJv9w1a5A/ZDzreCEw6uVXPdPFrUv2 2jM/QZG/LuAV4+rGRD1nzld5h8Cyj6XjaWBsejsWq+cCi4JTVAsgQfajKBU65Zhcl5uG qoKHilsJSma1qLoOQoQ4o0XjfDnTnFLxj452oL5npBJ1pFfSBQhM1tIqRK7mkeqGasGY O3gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YMZnc2V2; 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 de36si14565645ejc.582.2021.08.29.09.42.42; Sun, 29 Aug 2021 09:43:09 -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=YMZnc2V2; 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 S235720AbhH2QmD (ORCPT + 99 others); Sun, 29 Aug 2021 12:42:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229557AbhH2Qlv (ORCPT ); Sun, 29 Aug 2021 12:41:51 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52C7FC061575; Sun, 29 Aug 2021 09:40:59 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id f22so13029073qkm.5; Sun, 29 Aug 2021 09:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ji321exc53a4JxTUvbkiptwl4tQt4o11O/DIl8Ea0bw=; b=YMZnc2V2Y4FQ+/uhBKwsIeyZewJ4seAQpd86JDxoz+Q1Btrbv1z0KVkt2jmRFdPjuW EIQhozgo0gMFQQRsijsq8sr/yvZPlD9T8gMW9mwIo2Y2RKOtb1AdXOOVT6BEg2LkR91x VNO4cj/lt9QBH5+SxfxeG7m5tBMJPY9BV91gepWTQ5x98tTJjfKuQkWi/Rz+uuJkmeC8 gb1P8VBUI4t5v8iIfLI1WVaBjY6ZDz1niF/Levavy3qdBy70mqXKlmh84WAxeEHXi6Bv JRI/sF01jS+Wj6d+n0/je90SpgNhCIJjQF3Xlv9gfIQFsspPOhO8+HF53PiBsXf68upR 9N8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Ji321exc53a4JxTUvbkiptwl4tQt4o11O/DIl8Ea0bw=; b=krFn9nzS6z57JjAFqVTXrVRK21ow+hIkLPDux7GrEODQ+1NZYipZyLg2mL1OGly5XU 45NwVDw7uLeXneKfxBaze4WmxAWO43CaMy7l3iarWzlsA/a+b641azXZby8LW2+Gyd5b gXSAs3s4FJnEJwbhhLsssyTYBP5lQ8pjF7whcwVSXEyW7gWHD8vQEszFdO1wIgSPkDKD PjX3qtrN5gc230NbDjNuEOPesbggywsYnADtVA16VNjlxh6gFpTxBEIx6wsmOHoKIrDs zbkmh+CATmrf0piKXhqVwxA6XRYQJIuH63BpOCU3I0Slq4ZHuUkayUZt+Ry2S9/1GX5g evvg== X-Gm-Message-State: AOAM533BwBgSk9twrVofz4w0j3QUENPOR72dBHyE+MBQ/oAVluv806Dp NV6A3HaReULkoLBR9IOWYaNyc3YBSTZ3JQ== X-Received: by 2002:a37:aa8f:: with SMTP id t137mr18617012qke.30.1630255258513; Sun, 29 Aug 2021 09:40:58 -0700 (PDT) Received: from shaak (198-48-202-89.cpe.pppoe.ca. [198.48.202.89]) by smtp.gmail.com with ESMTPSA id h24sm7162614qtp.63.2021.08.29.09.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 09:40:57 -0700 (PDT) Date: Sun, 29 Aug 2021 12:40:55 -0400 From: Liam Beguin To: Jonathan Cameron Cc: Andy Shevchenko , Lars-Peter Clausen , Michael Hennerich , Charles-Antoine Couret , Nuno =?iso-8859-1?Q?S=E1?= , Linux Kernel Mailing List , linux-iio , devicetree , Rob Herring Subject: Re: [PATCH v6 3/5] iio: adc: ad7949: add vref selection support Message-ID: References: <20210815213309.2847711-1-liambeguin@gmail.com> <20210815213309.2847711-4-liambeguin@gmail.com> <20210829153539.3b2cf037@jic23-huawei> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210829153539.3b2cf037@jic23-huawei> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 29, 2021 at 03:35:39PM +0100, Jonathan Cameron wrote: > On Mon, 16 Aug 2021 16:12:58 +0300 > Andy Shevchenko wrote: > > > On Mon, Aug 16, 2021 at 4:07 PM Liam Beguin wrote: > > > On Mon Aug 16, 2021 at 8:48 AM EDT, Andy Shevchenko wrote: > > > > 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. > > > > > > I'm not against getting rid of it, but I was asked to check for these > > > errors in earlier revisions of the patch. > > > > Okay, I leave it to you, guys, to decide, just note that the usual > > pattern for optional stuff > > a) either check for (!ret); > > b) or ignore the returned value completely. > Hi Jonathan, > Hmm. My thinking (I suspect I asked for it to be checked, but can't remember :) > was that I'd really like to know if a device tree contains a property but that > property is invalid for some reason. The docs give a bunch of reasons beyond > the property not existing (which is unhelpfully described as just 'invalid parameters'). > > I guess that's a bit far fetched. Let's drop the check as Andy suggests. > Understood, Thanks for making the change. Liam > Dropped that check and applied to the togreg branch of iio.git, initially pushed out > as testing for 0-day to poke at it. + we are about to enter merge window so I don't > want linux-next to pick it up just yet! > > Jonathan > > > > > > > > > > + dev_err(dev, "invalid value for adi,internal-ref-microvolt\n"); > > > > > > > + return ret; > > > > > > > + } > > > > >