Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1863376rwl; Sat, 8 Apr 2023 03:32:08 -0700 (PDT) X-Google-Smtp-Source: AKy350bAc6h+Rt0iO/hYroCpgRpEhWp7FfIfxFE15sBzhN1dQtUlpRTRsjt+JkEgTmNBjFytkheL X-Received: by 2002:a17:90a:520c:b0:244:99f4:2ef3 with SMTP id v12-20020a17090a520c00b0024499f42ef3mr6023164pjh.0.1680949927998; Sat, 08 Apr 2023 03:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680949927; cv=none; d=google.com; s=arc-20160816; b=FQpk1W28YfSIhlXFlb3ETenggCz1/vDo+zuzlsNNqZsTsWHE9gQBoNSspNghvKvJ6P WQJpsswQeaHxDDrgSbi6gYCb+gfUAUW4YVfjzXQ0kFVbbvrDOQfHUhinH5KTP+RdEqrq MEqphoZ7vSyAMJI2HLGmGvrn0V4J2H5d1nGfHbvCZs7u+86CTx2yNwdChBairFly5ggK vwcpAIMRtdBqXWc40qbsc0udSSLvrKrNtFsTslNLvIA7DY5jMXWr8lQX31AFK6WD8bPL 2VSLSBvbO7SPTu182zy6tqyjJTj2oJjmqvDABEY2zqXGpB1vsTTcUje7Rhfs/sRuy2Xt OSCA== 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=JFRB7/E0uCDaYIhmNwT1ssgW9dLTa7lFOn/EZfKKGNU=; b=sU6XvK2mYG7UD+EDfUT6aApGPeepe3jeQmPZom08FvYG6OdghNFMuByMIDKvq6y3Zr GdA8R5RBktVpGxtKbSiF30AkBKeIKunu8jOj7iJLCjlTvjqLhfzElem39gF2EuOWw7UU NqBgmu5YfxHRKYEnS3B7l0JSjTWv0pIlepK6L/sCiKuMwgCYwryCpJsHoxx7if4BUjeP bpbSbnl0UKLB+saqT+95xP9rAh2wFqnZCAtVPkEOKceLuv2MSldqOHWJJcMw6IHQ5rfI TeXlTEz3Eian+gjgpBXlfPwYaVrp96Ftc5/CLDkvAaBtKksuzpS42B4uI2Z7fToax7dz mFIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ow45UjOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a654c02000000b0050f74bf6b3asi5624268pgq.700.2023.04.08.03.31.56; Sat, 08 Apr 2023 03:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ow45UjOX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229755AbjDHK0Y (ORCPT + 99 others); Sat, 8 Apr 2023 06:26:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbjDHK0W (ORCPT ); Sat, 8 Apr 2023 06:26:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50E98E1B0; Sat, 8 Apr 2023 03:25:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B7CAA60C24; Sat, 8 Apr 2023 10:25:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D45C9C433EF; Sat, 8 Apr 2023 10:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680949540; bh=WO8/ut7eSs00MBuh1VFQISY1mwz4+Sr58kEes4CQWU8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ow45UjOX+U1eiQYdBsP1yZoISuVroORCNra6wM6XYFa2Nxx0RlpoVbduaQDp9TjVv aGcKBwxRHUtUn/bBzRVXI6A8G+utSZgAmsuOngueHy4BDIs7RiFw8L6EvGjW8BGtUm 22zW+QvXFft6D0aZPQn7EadsUd6rY3qbFa3QsTQbDaJ8P0+VYQNGuZXnF+EwOLuoXs rhuHDelKS6eoRvQ71z9Q+xGXbd5BbFu5e0SU0Hff+LnFbRvqkpWKWZDPGEvQmgPsII ZPSCEZyM+DxEB7zt0ahnjdbcp9TNDW8SL5LjWLnv3tV5RuZ9CsvtoX6OKOBPl92J+k 0Zy1RObBRRJnA== Date: Sat, 8 Apr 2023 11:40:55 +0100 From: Jonathan Cameron To: Naresh Solanki Cc: Lars-Peter Clausen , Patrick Rudolph , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH v3 1/2] iio: max597x: Add support for max597x Message-ID: <20230408114055.474a597a@jic23-huawei> In-Reply-To: References: <20230328094416.3851801-1-Naresh.Solanki@9elements.com> <20230402180123.0fc1cfde@jic23-huawei> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; 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=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Apr 2023 15:37:21 +0530 Naresh Solanki wrote: > Hi Jonathan, > > On 02-04-2023 10:31 pm, Jonathan Cameron wrote: > > On Tue, 28 Mar 2023 11:44:14 +0200 > > Naresh Solanki wrote: > > > >> From: Patrick Rudolph > >> > >> max5970 & max5978 has 10bit ADC for voltage & current > >> monitoring. > >> Use iio framework to expose the same in sysfs. > >> > >> Signed-off-by: Patrick Rudolph > >> Signed-off-by: Naresh Solanki > >> ... > > > > --- not ... > > > > As I mentioned in my reply to v2 thread (which crossed with this v3) > > I'd like this series to be cc'd to the list and maintainers for Hwmon > > with a cover letter explaining the reasoning for it being an IIO driver > > + the restrictions that potentially brings. > Sure. A minor request from me for future replies to make things a little more efficient. Note I'm not always great at this myself - this is a case of do as I say rather than as I do! Don't bother agreeing with stuff - reviewers assume you agree unless you comment! Crop out any sections of the email reply that have no new content. e.g. ... > >> +static int max597x_iio_probe(struct platform_device *pdev) > >> +{ > >> + struct max597x_data *max597x = dev_get_drvdata(pdev->dev.parent); > >> + struct regmap *regmap = dev_get_regmap(pdev->dev.parent, NULL); > >> + struct iio_dev *indio_dev; > >> + struct max597x_iio *priv; > >> + int ret, i; > >> + > >> + if (!regmap) > >> + return -EPROBE_DEFER; > >> + > >> + if (!max597x || !max597x->num_switches) > >> + return -EPROBE_DEFER; > >> + > >> + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*priv)); > >> + if (!indio_dev) > >> + return dev_err_probe(&pdev->dev, -ENOMEM, > >> + "failed to allocate iio device\n"); > >> + > >> + indio_dev->info = &max597x_adc_iio_info; > >> + indio_dev->modes = INDIO_DIRECT_MODE; > >> + > >> + switch (max597x->num_switches) { > > > > Having a value 'num_switches' that maps to a set of enums called _TYPE_ is unusual. > > Perhaps rename it to type. > Will add a local variable type to track the same within with driver. Not totally sure what you mean. I'll look for it in newer versions. Thanks, Jonathan