Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1923876rdh; Sat, 25 Nov 2023 07:20:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgEM8eQwJ16gogRcXRY8lRtq4iT57sEzx1pP1F1eyQutAXPQDeMvwI3muekcwnVAtsQDOb X-Received: by 2002:a17:902:e544:b0:1cc:5549:aabd with SMTP id n4-20020a170902e54400b001cc5549aabdmr8023830plf.8.1700925617091; Sat, 25 Nov 2023 07:20:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700925617; cv=none; d=google.com; s=arc-20160816; b=DHktiAfcCM9mxfWxx7jAo1KJxJJ1U/D8xTORFsConMll371tfZrcCWhJbGY0VMR8Tu Ao2Rg3jvQkAgnEolRsP8znPMN0eQewAO1uLqrFZPH5SLwMDh6xWLiOVq3KWLdjrFmQGP wbxIQ46ZUqo62nhp9YzMxJNSsKEyYNOF0J7IxWQ+ssVBJVKhiKzLixPWVFmwD5HeaTz5 zeFcSr6OhC8VF9bFGyE7kiO1ky3AOa86T4sTydntWoUa0xJ/dxu60wV8uQiWng6SrVEK Zcg+/aL9PK02OuEk5SWkCpGO0XXVNGPPVhbMs9okeDDvXfUqx/8n7oMtwfB7NE80QyRT yikw== 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=OUvdxaexCL8JWLV6Q1RRb6FFzoZH3nZvam5bxN1JOTs=; fh=cIqgCqlhLmySTJqlsTTL2MsRPz108+Nl75PdP04hyOk=; b=gOpLL15K7SxjgNSlf2XTCh6KJZfPBCsGy6ewBZod/whAviC9JuMF8lGJ7qaTG/mOXe yu69gPOBiXTJ1FodCSeZFgfNRDM6rUCwNSx74pyksbZqPIKWM4YZw0lvgSVGEfa+rk20 HYiQ00EP3c9iFyITJQmk31v7nDw3VuGZ6TMAHOEHjL7FL7SzlrAKhJBFHuHWTeK2gMc0 ft4n5/cwI2pIQpsiFAbYg+UEvaJ7IN4gOhHMtBYN+xIdPL7FWBvpuJTnfLh9dyIf4wA1 prrmtu3deek5PKbcL5lPHPlJlWn6M9vDyGCW4KkK0Yz9uqf0FcqV5tL+yGj38SCGS7JE H2Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HEDX8mPb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h20-20020a170902f7d400b001cfc03c0e88si202792plw.579.2023.11.25.07.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 07:20:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HEDX8mPb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id D92D3804E809; Sat, 25 Nov 2023 07:20:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231976AbjKYPUD (ORCPT + 99 others); Sat, 25 Nov 2023 10:20:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbjKYPUB (ORCPT ); Sat, 25 Nov 2023 10:20:01 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31884101 for ; Sat, 25 Nov 2023 07:20:08 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A854C433C8; Sat, 25 Nov 2023 15:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700925607; bh=1pvnCX5R8u7RfMiNPMMmS+WyuEpdLzjE3FRiy8NZtag=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HEDX8mPbSBds2f9EPZIoR4PeAeVug9LqWOLy4sEKt1ZLgpSQ81ClVczXPJH7ok8/n xlur70r2f2X8KOkin4mEpIGOWbCVYwxPglQUXK0793tK0lQNkt/TWAR643uOgymRDX JMnau9dxkkRPbnvWXrwGoQY7I/743LfrKMY1TJgFd0vMNHrU3rD1PbPi8/+EbL10WE s6P2+EOTMsuInMFG26T/EUwZtaEHItecdAjYRs9rGA1Wr4tLSAhndiPXYTo+g+Jp7q 3eDaoTl7tce+RxUhSK1CgLxBWFl9QQ4nnFqOtgKR/QHoBGlS7+sn8rIccdMAnxdp/R YBM8wLekOBbwg== Date: Sat, 25 Nov 2023 15:19:59 +0000 From: Jonathan Cameron To: Crt Mori Cc: Kim Seer Paller , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 2/2] iio: frequency: admfm2000: New driver Message-ID: <20231125151959.00261229@jic23-huawei> In-Reply-To: References: <20231123094357.222371-1-kimseer.paller@analog.com> <20231123094357.222371-2-kimseer.paller@analog.com> 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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 25 Nov 2023 07:20:16 -0800 (PST) On Thu, 23 Nov 2023 11:19:51 +0100 Crt Mori wrote: > Hi, > Just minor remark inline. > > Best regards, > Crt Hi Crt, Please crop replies / reviews to only relevant context. If there are lots of comments it maybe fine to leave whole driver but that's not the case ehre. Should only see something like... Thanks, Jonathan > > On Thu, 23 Nov 2023 at 10:44, Kim Seer Paller wrote: > > > > Dual microwave down converter module with input RF and LO frequency > > ranges from 0.5 to 32 GHz and an output IF frequency range from 0.1 to > > 8 GHz. It consists of a LNA, mixer, IF filter, DSA, and IF amplifier > > for each down conversion path. > > > > Signed-off-by: Kim Seer Paller > > --- ... > > +static int admfm2000_setup(struct admfm2000_state *st, > > + struct iio_dev *indio_dev) > > +{ ... > > + if (st->dsa_gpios[1]->ndescs != ADMF20000_DSA_GPIOS) { > > + dev_err_probe(dev, -ENODEV, "%d GPIOs needed to operate\n", > > + ADMF20000_DSA_GPIOS); > > no return -ENODEV here? > > > + } > > + > > + return 0; > > +} > > + > > +static int admfm2000_probe(struct platform_device *pdev) > > +{ > > + struct device *dev = &pdev->dev; > > + struct iio_dev *indio_dev; > > + struct admfm2000_state *st; > > + int ret; > > Order these in reverse christmass tree like you did above. > > > > + > > + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); > > + if (!indio_dev) > > + return -ENOMEM; > > + > > + st = iio_priv(indio_dev); > > + > > + indio_dev->name = "admfm2000"; > > + indio_dev->num_channels = ARRAY_SIZE(admfm2000_channels); > > + indio_dev->channels = admfm2000_channels; > > + indio_dev->info = &admfm2000_info; > > + indio_dev->modes = INDIO_DIRECT_MODE; > > + > > + st->gain[0] = ADMF20000_DEFAULT_GAIN; > > + st->gain[1] = ADMF20000_DEFAULT_GAIN; > > + > > + mutex_init(&st->lock); > > + > > + ret = admfm2000_setup(st, indio_dev); > > + if (ret) > > + return ret; > > + > > + ret = admfm2000_channel_config(st, indio_dev); > > + if (ret) > > + return ret; > > + > > + return devm_iio_device_register(dev, indio_dev); > > +} Thanks, Jonathan