Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp251826lqp; Tue, 11 Jun 2024 03:34:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVX0jJ93tGBozp9KyIGF6Y+1t7YlKLPjSTxj2pMinuAfkGNX9hpZhJJEz30o1f4h3ZY7WvPNSr4HNn48rw23ArboG02M4JxJSU45NAaLw== X-Google-Smtp-Source: AGHT+IF9k6dYwvm2whH+zYRuzpyTPqrPtpDi7YqK2uKfejPv61ABGzvN6YW/Abijhy3BYjUAEQpg X-Received: by 2002:a05:6214:3389:b0:6ae:4dea:6c69 with SMTP id 6a1803df08f44-6b059f2d840mr135118646d6.63.1718102090564; Tue, 11 Jun 2024 03:34:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718102090; cv=pass; d=google.com; s=arc-20160816; b=kYDhAUdBlwuLv6X5eltxwByJpoKwh+gdxwBcrqtZHXCqaRWW/wHjDb1u8Qmurp9v0e kPA/fZVCQ4JXoapYhz16/VF9Bw+Z6OFlPDmPDtU6tVs3w0dT/h1+uvDCh9bvdSoGgYUj x5XZVx+tanOjDDZh6Hu8+G3Nr2/e2yuE7qbh5APJeai5i47aUbyq5ZCbzToXO5FOiD9n yJkwFSDtdbp/Dn9neNFMdFWzzUbFLlXH4d2iso/FfUP8ek4QxmxX5AWfe5yW8XMVVdyz MZUw91f1n51qdRgHhFhhxFC4NPTmVpRLWN4xzsSrI+J/bqNaMBbfs2BxmQ3utvMnbSb+ /NXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from; bh=lrmmz9T7DXWJN3P9kXaNA/HTXUGALX6pJJQCculJR74=; fh=fK7OHdOsgNfHqs/sf0yDfXCeiuRNZcFbg0cm4sAAvT8=; b=gmOPzc1WqB61kWT+qoNasLFYDomG7TgoZYSW+MgwscrmRK3GuRGiCiafcfDRvbxej2 vQaLBMv5urX8bArbWUcL3kTFh1/yINLWOKJae4SauQk+JLxp9U3McA0xMEep+5tAOuiL YWJMhA738ibP6jHfAsVZjBaAy/ALjG5pdfts+OtkaTKFXBeDz6DwR5yjQgHQ0mpKKi1N Mfjx+UDbZdGB4x/tvVAaeqBkhWHv6s/KBXl4U9uFESHztvt8bCfmXcUZJm3Ar1N7yZ1C bP7NCHrM7Rd+SIRNXjhsK3IsCGorKJep0G/PW8nqvgIXQKzD6dnW33oXk+1OXSNiBBZy fDXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-209650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b064604b32si90762726d6.299.2024.06.11.03.34.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 03:34:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-209650-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 47CE51C239BE for ; Tue, 11 Jun 2024 10:34:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF00C179957; Tue, 11 Jun 2024 10:34:34 +0000 (UTC) Received: from fgw22-7.mail.saunalahti.fi (fgw22-7.mail.saunalahti.fi [62.142.5.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED3CD7407C for ; Tue, 11 Jun 2024 10:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.83 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718102074; cv=none; b=mhMjK7kAJzjldc00nsLN5Dvmtqa2lD0S17iTD9gGggeBfxyiowNsSVfaz5ZILqKjDXayV7xVrHyOzifjNXDM6nJGn5doQTsS8bFz8uDJufKQCdbLD7hCbkoNZ0OlYck80ZFDxTuwg36AjK9yTE7vRDSVB6egLBrCnizLNFnrtPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718102074; c=relaxed/simple; bh=DiUx+fa2fiEm8dYh/SFoSIXBAOSLzwFVSfuuBFb1ZLs=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tcYJ4L8lEY4wajC5hCHYIBo0JMjxLvGp3r3C6qmaErdpDcQ4bvLDLfyfICMAcI9UCgJPx9sJmT9Kk2JraA/4sHDaKAsbUI1F45RDz2Tm8z/TFUg99XH3lIFbVAxGV7V1uyA9JEeOhc10zFXONwc7aTF27RYyzyjxlFkwkwsGGhQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-25-87.elisa-laajakaista.fi [88.113.25.87]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 2edfd6f0-27de-11ef-ab0f-005056bdd08f; Tue, 11 Jun 2024 13:34:30 +0300 (EEST) From: Andy Shevchenko Date: Tue, 11 Jun 2024 13:34:29 +0300 To: Jonathan Cameron Cc: Nuno =?iso-8859-1?Q?S=E1?= , Marcelo Schmitt , broonie@kernel.org, lars@metafoo.de, Michael.Hennerich@analog.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, nuno.sa@analog.com, dlechner@baylibre.com, marcelo.schmitt1@gmail.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Subject: Re: [PATCH v3 6/6] iio: adc: Add support for AD4000 Message-ID: References: <20240609102354.02aa1128@jic23-huawei> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240609102354.02aa1128@jic23-huawei> Sun, Jun 09, 2024 at 10:23:54AM +0100, Jonathan Cameron kirjoitti: ... > > > + /* > > > + * In 4-wire mode, the CNV line is held high for the entire > > > conversion > > > + * and acquisition process. In other modes st->cnv_gpio is NULL and > > > is > > > + * ignored (CS is wired to CNV in those cases). > > > + */ > > > + gpiod_set_value_cansleep(st->cnv_gpio, 1); > > > > Not sure it's a good practise to assume internal details as you're going for > > GPIO. I would prefer to have an explicit check for st->cnv_gpio being NULL or > > not. > > Hmm. I had it in my head that this was documented behaviour, but > I can't find such in the docs, so agreed checking it makes sense. > > I would be very surprised if this ever changed as it's one of the > things that makes optional gpios easy to work with but who knows! Not Linus and not Bart, but we have tons of drivers that call GPIO APIs unconditionally as long as they want optional GPIO. What I see here is the comment that should be rewritten to say something like "if GPIO is defined blablabla, otherwise blablabla." I.o.w. do not mention that implementation detail (being NULL, i.e. optional). -- With Best Regards, Andy Shevchenko