Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2541703rdb; Wed, 4 Oct 2023 04:41:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpkJF9g/wJLgv9CWYb4XAFsT0NFtxnrH1+VCyZDitECFictBkn/cpNgwxd/3UMc2Z8eEbn X-Received: by 2002:a17:902:a604:b0:1c7:37e2:13fb with SMTP id u4-20020a170902a60400b001c737e213fbmr1975538plq.55.1696419694804; Wed, 04 Oct 2023 04:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696419694; cv=none; d=google.com; s=arc-20160816; b=VcQDDgdIFhtI1Ma3mI4uemtD9uGoDg7INrUasdfyzkO8xGZB+orpmNnsONG2GcHyyN lTA9wWkiT3SRyP4+JfHz5Jqrp+vqhq2dLbc4eXdWIZprNqY9KpU/TX6tu2L7StZ/gn61 UQEdljIzVTlrdexuiIV1WWx3cRMkJAsFQhfwWMc6QpAMTBbmVYRe6wZHH5DtZ8cFD86J Qq3K4riG5M65M35XJgosi3gWA9Ko4aTzJRbtOIvex4zDYHDm6CNpgz1ehFQ1LWAak/II WAwos3cT9gfBv3tQ7W39SgrfgMbwWuJ0aVh0CoZ7LpQP40cGZ1Z4TAqGXw/Kckl3Piz8 Nkcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZBqjb8SBtq9wVTBrX0JB2VzFgWKS26/mLUuG0CMFwr4=; fh=Hgmrl8hzMv/iSDqu2ZSMdl0gC6IOybuPgoENw9+mWus=; b=TCINO32DpUyY53FkOjOZ3VfwFPGfSDZs+lc6pcB4H8ToB0+v8ip31fno/QIdcgiiSh 13eaWYSpu6hxR+hJv1TBJ2ywQm86Oc/DIzO75lXneoI9Mq0HoapXyZAfemk8xDx1oQW1 95rrHzeZQ7eDzsPqr0x93DUFAZHk8ymMxxOCKcaev+19jCkFSeDQ1HQBlTuqzO46lHvi UxRXZ0jEALlvOMV3lE3JK6Bb2hagHN3gcxszHht/KWXwiH4M2UBF0/ks93fZjwiPJFSF /nCsYjTSJv0OGeNr8QZktas66S4BvLt4uialoSozhqucWeuOH7y1WhIbUT39O8QrMZIG goDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=VzU7r7ul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id be8-20020a170902aa0800b001bdd58f685fsi3411937plb.85.2023.10.04.04.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 04:41:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=VzU7r7ul; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 74CC1826638A; Wed, 4 Oct 2023 04:41:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242292AbjJDLlR (ORCPT + 99 others); Wed, 4 Oct 2023 07:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242295AbjJDLlQ (ORCPT ); Wed, 4 Oct 2023 07:41:16 -0400 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E373D9 for ; Wed, 4 Oct 2023 04:41:12 -0700 (PDT) Received: by mail-vs1-xe30.google.com with SMTP id ada2fe7eead31-4510182fe69so911919137.3 for ; Wed, 04 Oct 2023 04:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696419671; x=1697024471; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZBqjb8SBtq9wVTBrX0JB2VzFgWKS26/mLUuG0CMFwr4=; b=VzU7r7uljraGt3khbyWnqfcWqKIbVBE/2K8saryW14OlL6YB1/Ul33p/HovDCNm3c+ +YwV4xcIHWI9b8xUF3teSP39RHjSI7awr7C5WSZI2tDs+cUm4GBOh+EiBOoyzJndM0OZ 1OkXfflP03135w71YZUAjzrvsotxMwW4prtvHNISNh7E9nQlWWDiMKs64krF4PwHhw6t QTQ4YYojYeWpKf0nvjvVsh5Cnd58Q8KPX9PVxiX+Be2ddoSucyC3DxHc0cr2/M00937q /1hVCDyNOCLuzQkcuZp7ts6Qe9wdkvhLQ6iMt4z7nkEct1zJMnEU76xJSTz62aiTuxFR gsUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696419671; x=1697024471; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZBqjb8SBtq9wVTBrX0JB2VzFgWKS26/mLUuG0CMFwr4=; b=TcBnp+c4uCwgm2uif/8zQrMo78skJ1d09Wk56rdNkSpzcxHMIKvv9dPDnLMqF8wrX2 +IEJt7zAAX+qkXZGwDKYqgWH+2O7Qq2ySyf2Fgf5yq9O1N0E65RldYnT2So8qqWMqSbq Y1yIQnd7yb6KoYfk5OEOafwGwPTfaisrVoPCaJAv/dgbQcLoIcnqQ6OMxAkAVu/z1lnG RqeUwcsXn8N7JdIHCfL9qqwDIe2JyDOB1zr+uB0oY5jJ1DnOiSoHmvo8V08ZngD4t049 v2Y2fdGRVV8BZCplvSOg5ofta7suUWdt4pUp+D+vn4I4123waXnwiYrLff3sSdztYqfi ULhw== X-Gm-Message-State: AOJu0YzHE2XdE+H8U9M7hIPfMaOpjhrEtpLbLwBVzQX7bX5nh6ByaKnR tb9z7w/k7fLm2073RL0VJdEUBmDXJruC7mmy6L3ydQ== X-Received: by 2002:a67:ed83:0:b0:452:7c1b:d57c with SMTP id d3-20020a67ed83000000b004527c1bd57cmr1243121vsp.28.1696419671631; Wed, 04 Oct 2023 04:41:11 -0700 (PDT) MIME-Version: 1.0 References: <20231002-gpiodoc-v1-1-a8ec8376bbf1@linaro.org> In-Reply-To: <20231002-gpiodoc-v1-1-a8ec8376bbf1@linaro.org> From: Bartosz Golaszewski Date: Wed, 4 Oct 2023 13:41:00 +0200 Message-ID: Subject: Re: [PATCH] gpio: Further document optional GPIOLIB To: Linus Walleij Cc: Andy Shevchenko , Jonathan Corbet , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 04:41:32 -0700 (PDT) On Mon, Oct 2, 2023 at 10:12=E2=80=AFAM Linus Walleij wrote: > > Optional GPIOLIB as in not depended on or selected by a driver > should NOT use any *_optional() calls, this becomes paradoxical. > > Signed-off-by: Linus Walleij > --- > Documentation/driver-api/gpio/consumer.rst | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/Documentation/driver-api/gpio/consumer.rst b/Documentation/d= river-api/gpio/consumer.rst > index de6fc79ad6f0..3e588b9d678c 100644 > --- a/Documentation/driver-api/gpio/consumer.rst > +++ b/Documentation/driver-api/gpio/consumer.rst > @@ -29,6 +29,10 @@ warnings. These stubs are used for two use cases: > will use it under other compile-time configurations. In this case the > consumer must make sure not to call into these functions, or the user = will > be met with console warnings that may be perceived as intimidating. > + Combining truly optional GPIOLIB usage with calls to > + ``[devm_]gpiod_get_optional()`` is a *bad idea*, and will result in we= ird > + error messages. Use the ordinary getter functions with optional GPIOLI= B: > + some open coding of error handling should be expected when you do this= . > > All the functions that work with the descriptor-based GPIO interface are > prefixed with ``gpiod_``. The ``gpio_`` prefix is used for the legacy > > --- > base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d > change-id: 20231002-gpiodoc-cf9430641b91 > > Best regards, > -- > Linus Walleij > Applied, thanks! Bart