From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DE9CC4167B for ; Sat, 25 Nov 2023 19:15:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229746AbjKYTPc (ORCPT ); Sat, 25 Nov 2023 14:15:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjKYTPb (ORCPT ); Sat, 25 Nov 2023 14:15:31 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49459C2 for ; Sat, 25 Nov 2023 11:15:38 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF474C433C8; Sat, 25 Nov 2023 19:15:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700939737; bh=5U6ilYOb9JOBKF6J2hmo2yKz7KIJBaspaNBWIMEXAHk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YTzcUKjFn88nrPC276FOv9e7ls8eMT58+rj30j/T4s2A7y3BkJMBbmH7QOYsaopqG LY6qRwSxN5IgfrjsRcrHhFwV6XZt51lQWyev1EXhJUU5t4zIJ/Pti9u3uCujYw1rhG TIRznnqXUt49PChQSzcOKOdbQN1x3kI7b4oBukIdo6d3+HwEVSCf7bCN+PpJc+wUJG JDxpIlCLZM5KbsdJnaCXMS3wFVVxrCj2EU1GHNKd9V/9RnRUUJtGOpe3yUvWuVl6Pu EvDhAVVIBcrRnnknE9+T+3JCPvTMVnpVzCGYZHkgG2Eqz91LFEgQmrtmC7zRKNQuAt F22rScENy/EdA== Date: Sat, 25 Nov 2023 19:15:29 +0000 From: Jonathan Cameron To: Andy Shevchenko Cc: Petre Rodan , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Lars-Peter Clausen , Angel Iglesias , Matti Vaittinen , Andreas Klinger , Rob Herring , Krzysztof Kozlowski Subject: Re: [PATCH 2/2] iio: pressure: driver for Honeywell HSC/SSC series pressure sensors Message-ID: <20231125191529.2ed1ddfb@jic23-huawei> In-Reply-To: References: <20231117164232.8474-1-petre.rodan@subdimension.ro> <20231117164232.8474-2-petre.rodan@subdimension.ro> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > + ret = devm_regulator_get_enable_optional(dev, "vdd"); > > > > + if (ret == -EPROBE_DEFER) > > > > + return -EPROBE_DEFER; > > > > > > Oh, boy, this should check for ENODEV or so, yeah, regulator APIs a bit > > > interesting. > > > > since I'm unable to test this I'd rather remove the block altogether. > > if I go the ENODEV route my module will never load since I can't see any > > vdd-supply support on my devboard. > > No, what I meant is to have something like > > if (ret) { > if (ret != -ENODEV) > return ret; > ...regulator is not present... > } > > This is how it's being used in dozens of places in the kernel. Just utilize > `git grep ...` which should be a top-10 tool for the Linux kernel developer. As per my very late reply to previous email. Nope. This regulator is never not present. It's just a question of whether the firmware tells us what it is, or it is supplied with a stub regulator.