Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2044366rdh; Sat, 25 Nov 2023 11:14:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHKYRWy5IZASMmDGvMKkZBZIRBls13ZNS5lduaRQtNPjflcLY3uN5tixyH8RVTLCK7TgmGT X-Received: by 2002:a05:6a00:3015:b0:6ca:2b55:58b7 with SMTP id ay21-20020a056a00301500b006ca2b5558b7mr7654710pfb.20.1700939643593; Sat, 25 Nov 2023 11:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700939643; cv=none; d=google.com; s=arc-20160816; b=reKx7L8PnNMTbu5Helgw72Q9k3XnhZfzIvgM598X8cXN4V4cpalkFC9FvMYmrORRsE EFxUlddnKiLX7XypOxEX/qSyviYekXRIZtgU/mAC8UX5FaakCMhxJ01sulnFf3mOI3gL NVOE2HuAUHgDwkYrRcAh3X0+fPAx/I/rS/a8J2rrALQg71v/1okmCbTQnJr0/jPTELvj bj4xqodamS2ENLACgrVpHOuu6OXuGgx84Vzv4RwJuo60PFw7xXSNHivTkCayXwyTtqEb GKTgyBN5jD8Nj7tAth4wWtOiplEH5gVgTKMGwduYWkOCJYaz7HV7TqqPW/rERnw3M7HX 7yaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=3d9Jtpr1qW5xBYDXoo6ZhZMUXzWX00XeHX8nbK+pk7U=; fh=mStihuEhUkk9Dj2OcpEU8QC2iPasGHLPGYNt+nGhjzo=; b=p+S8kNfIYIyXMWH8PDcLbLEofTGILpyDx1oXth3dNdq/1Scd8eJj3jMtTT/ffMdHdK qbQeEANZshbTvuuNKvfzEK0ffom1Ky3z1vpZie1BHDPraMZ3yLAefbf3tJEfz3FiQCKC XLG99I+IO6zLniDjVAqIP/VMqfVfah6H8OU1M5QqcVz994W98WSrLSxS2fP6Tas/VTy+ VTsZOabxN/zJWAbXFw5+067aoStSpLtIn0r6kUr86dnZ9LMbyXJJ8xAN35ADi5m9+JaF jDU6Ft92UmKes7OVvfdSOX44Bzk6AgBsyaSNl5M9fS5AY+puez9N77ZIRQKCIl03YvO7 j9KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TvVxdyO5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id j3-20020a056a00174300b006cb75e1d713si6107705pfc.193.2023.11.25.11.14.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 11:14:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TvVxdyO5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3181E8096456; Sat, 25 Nov 2023 11:14:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232277AbjKYTNr (ORCPT + 99 others); Sat, 25 Nov 2023 14:13:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbjKYTNq (ORCPT ); Sat, 25 Nov 2023 14:13:46 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432C2C2 for ; Sat, 25 Nov 2023 11:13:53 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E75CC433C8; Sat, 25 Nov 2023 19:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700939632; bh=0pMTcoXCwHtJRdFZBhJodqGwmnMP648ewc0W1JO0iX0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TvVxdyO5msPU1STSUW/0S3dp2uCnVj1HA0aAfRgUZpEp7ltLiFR+2Y/ox2W26Jq++ c6GKuJoThdtfj8rpBTRMOBlQCw8MT/J65nTGvsyil390J+VXt0zCVZteEjwhiu4Qe9 nPcC0Ek7/XXJoLNy8iLKD49NATP+5JbY7GFspfJsSEXeuyF7fanSo3rFpVty8Zw7xH TB9/QIuB7U+2oCnbAECBJhurcRpo0cwA3wa5qF1o5GlgLRCMYzylK9Xro1z84RgVCk ebrnjU8mKkhfUbXoMBL09/ROZHHdwgA2kIpTB5F9vKceFJ7XLQ4OGS5co9COEqnfsl HSSI9WCGn4BhQ== Date: Sat, 25 Nov 2023 19:13:43 +0000 From: Jonathan Cameron To: Petre Rodan Cc: Andy Shevchenko , 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: <20231125191343.30fc4825@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 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Sat, 25 Nov 2023 11:14:01 -0800 (PST) On Wed, 22 Nov 2023 08:08:27 +0200 Petre Rodan wrote: > hello, > > first of all, thank you for the code review. > in the interest of brevity I will skip all comments where I simply remove the block, blankline, or fix indentation. > > On Mon, Nov 20, 2023 at 02:35:39PM +0200, Andy Shevchenko wrote: > > > + select HSC030PA_I2C if (I2C) > > > + select HSC030PA_SPI if (SPI_MASTER) > > > > Unneeded parentheses > > ack Where you agree, just crop it out. Saves on scrolling! > > > + case IIO_CHAN_INFO_RAW: > > > + mutex_lock(&data->lock); > > > + ret = hsc_get_measurement(data); > > > + mutex_unlock(&data->lock); > > > > Use guard() operator from cleanup.h. > > I'm not familiar with that, for the time being I'll stick to mutex_lock/unlock if you don't mind. > It's simple and worth taking a look for new drivers as it makes some error paths much much simpler. I'm sitting on a big set that applies it to quite few IIO drivers. > > > + 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. Problem here is why do you think that regulator is optional? Does your device work with out power? What is optional is whether the regulator is fixed and on and hence doesn't need to be in DT or whether it is specified there. That's unconnected to the enabling in driver. The call you have here is for when the power supply really is optional. That is the driver does something different if nothing is supplied on the pin. Typically this is used when we have option of either an internal reference voltage or supplying an external one. The absence on an external one means we fallback to only enabling the internal one. Jonathan