From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 918513AB482 for ; Wed, 3 Jun 2026 10:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780484080; cv=none; b=CNoO5w1++D7SMgl1AXa8KlRrDXSHilJPUA61uWd0IT2qs98FmHFWkqZkDBCr8OQKzW5UznTXf5Xtl3bJtKkVmaj8moXrcAefcj4hreS9tYCXTqcMhUK3iqw3l3OFSyeGKYBuKMF2TPx2fLlWMUtGS7uHlTW9qdM5cmk4z73xf8A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780484080; c=relaxed/simple; bh=tmrf2fIck4+7Bi+IcBroQJJi4SXIIt2ivLBx+FZgzQs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nv4v9FYk1MzzGHMnPMDJn/4keGS1YM+RS/RIVIIdXzKyhgXwbMSBM6T6F2l6Z5JTMDE5lCbsRwEa455RyqX1GavJgAtjGGKRFnduRpTSz/+/GGzeHv53vRFBCJhBBGyfOPFo45wC/+JfmNFoC2v10xfChSfGtMin1Jc6s0PeY+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JiUvjH7G; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JiUvjH7G" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-68cec9f4c6cso5661306a12.0 for ; Wed, 03 Jun 2026 03:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780484078; x=1781088878; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=l8xPodyUoWJlPI7e6lU/pFf27beG/+cguIPjhg9rv9w=; b=JiUvjH7GwM259TOKEyjzYS/CfTyBgnggAQxCGJesWdx2pNUU5BnCnrc0Iwp6QmawKJ Om8cT056bKXM3JbfQwAeCtVRQN8xZ/GG2ciyxYzL+29l0n0C7vrnENxZVO8VkJNbSnv6 tyvw+sACDSHT4Pvslf235fhHlAC/5IJcjuE7eSH1oN9AW8GxVcNQhCA68r1PLjBhOV/d ae4SPUGBMJheTsQ5zRF5AUXtspNphDCZAPlERJxPaRc+CWwxp7Lc/lomybh1Oie96BAi EZPayICirOuJmQABQZuyLnvOHJY1WJP9P//Yi5/pkAxa33xEkpcVOkSBnu9mkKZAe/zx vN+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780484078; x=1781088878; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l8xPodyUoWJlPI7e6lU/pFf27beG/+cguIPjhg9rv9w=; b=jOt+NHVPNNCOpSLNETis95m3yS0Zg7iE9cLJUF7NESMrR4ScH2ApzZQryh4uY4BKr/ pP3Jr5lo+HoCX9JqwNNPn1sVVfQmM/g1zp5V5Nqd9gFqusK7dn7Ms8qiCFbpexYHWB9e sjB9Ow4bOReVf0HLiU5aO4q+frvGAp0xM6lHmoQVed4cx1bYsNqWONKSK4TF/HwHI3sY JidZj9lqEdfp78Snml48RqRlbh3EdlmDGF5QP0JIkdVl7/r1zUi0Seiaysu09rV+AIr+ gWgBkKMZzI5Nt51wGb7+4Ova6Rb6rBzWYXU0BszwClgHGbVq7z2dbdP9M0SCuM84xJpy LJfA== X-Forwarded-Encrypted: i=1; AFNElJ/92c3Iz9P+p+tQZ3DPyMQaZ5pRJtcDeF8xlaj/WbaLZv+QRKQ62VmyvLOWKrSEfRJYh3onkR5VpOal9dA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5JQZxNiaAJnBjavyyqGGILfiPoPCHgqgr2QAt/1LwyBByixBe hRseLkGs8HisoIX9Qr3vZ/ZRXsy2ZLceKh6FfZTrnB531hIilqzQR6cP X-Gm-Gg: Acq92OGspgmXVxdJM9FtlmiyPBdJgYLMYwp+KSxYBOPMz3JShbjmvl6UIzKtS18LJyN 9J2e7fCilROEPDEb6fwEvC4bPCDKYRlcJmreLGX/vVPc4TRFuBCVIBI8KAUB5ByXXOqfaW7LA9b npjWHbyL9oIhGSFJIuo795JU4J+UDIgYgPfdpnML+S0GuWf05vdhQwn9WyLTJ2YwFoc2CsJfV/W 8kcyUmwmPKKkaWrJkCY4RPoU3xswWVgsFu/qFJZVzyIX2evB5QjTP7ttEp2udg11wJzpeCgTSNB CnPpVp5D7yes+HS/ieEAuaYwmmwGfKYMb+MIJk/YLab1eWXFgJuvaoFl7qNpAW16uY3MnN1ni6M rGl4hS7iBcckTt/jXnzszuEoseNDnz995ww4Zs6hGMTsR04FAs2JFSn4lKRVEzIxQbOVt2kEiP/ GQrrb4gtxopmlaxuMK7MBpdvZtv1s0bQ== X-Received: by 2002:a17:907:c28f:b0:bea:5cc7:95a4 with SMTP id a640c23a62f3a-bf0adceaa7dmr131107266b.0.1780484077830; Wed, 03 Jun 2026 03:54:37 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-bf05208e897sm131534866b.25.2026.06.03.03.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 03:54:37 -0700 (PDT) Date: Wed, 3 Jun 2026 13:54:33 +0300 From: Dan Carpenter To: Andy Shevchenko Cc: Taha Narimani , jic23@kernel.org, lars@metafoo.de, Michael.Hennerich@analog.com, gregkh@linuxfoundation.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: iio: adc: ad7816: Use devm_gpiod_get_optional() for busy GPIO Message-ID: References: <20260603123333.5608-1-tahanarimani3443@gmail.com> 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: On Wed, Jun 03, 2026 at 01:37:32PM +0300, Andy Shevchenko wrote: > On Wed, Jun 03, 2026 at 01:20:08PM +0300, Dan Carpenter wrote: > > On Wed, Jun 03, 2026 at 12:26:11PM +0300, Andy Shevchenko wrote: > > > On Wed, Jun 03, 2026 at 12:33:33PM +0000, Taha Narimani wrote: > > ... > > > > > - if (chip->id == ID_AD7817) { > > > > + if (chip->busy_pin) { > > > > > > If we get GPIO optional, this check wouldn't be necessary anymore as the below > > > should return 0 IIRC in this case. > > > > No, it's still necessary. It can be NULL because of the CONFIG_ > > in which case, sure, gpiod_get_value() is a no-op. But it can > > also be NULL because of the device tree and in that case we need > > the check to avoid a NULL pointer dereference. > > Can you elaborate on the latter more? I fail to see that. > What I see is that the function either implemented or not is NULL-aware. > Ah, yes. You're right. The VALIDATE_DESC() macro has a return hiding inside. I hadn't seen that. regards, dan carpenter