Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2511680rwd; Sun, 28 May 2023 17:51:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5GOliwiO98KDcQlZr/LCblp18+LtX19XPxyHEHwxrBaYyF1++hq8p7wc7VS2nTRPkPnEPQ X-Received: by 2002:a17:903:2302:b0:1af:dee0:173b with SMTP id d2-20020a170903230200b001afdee0173bmr11069621plh.48.1685321503841; Sun, 28 May 2023 17:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685321503; cv=none; d=google.com; s=arc-20160816; b=o70QjbNoM2QZmYkG3f8zIb1vJ3t6Jcx58JkanHw0c/CiiXhXuBfydTeYaLa3Ln1r70 GxBBSbCWizUdilAA7cKo52DGs+VEG+rIWHLW7YwC5ZvAlgu3DJ7ExGhO5+1lslqzWYU/ dsbTSuB7lNTGFIXrQu1ORtSPqSRCGGL0A4iWpNkLWqtVSzHOL+BlcWHnhBv8cfKRRe1M veZjBuuPw156eBcw8fhxW4rGQfXaRNQ8tQI5U/Iiq1VP/DdnWtuah0437p/XOB4M1DxY JIvMi4P08elhrMr0g6cJd9Mw/Qy0i7uLOCGBYSmaS4HeDhjqb5IRYpYagyYn0v4RAXwk TFjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=HkElOOdboRMnvG8MCHjaGN0ikwZzP2rWxba5a6fyuMk=; b=g+TTpqt/0aQI6sHHkAPoWcYXcQ6UZ4HlTxuNWM3kiSTAVg+BRBrS2ooswMHTTXMeoj dCbxX43kfNpIdFipO8fGWr7emtQ/QwzehhIfaOlPcCyj6ChqeryrYZArYpVSF31VtNeJ FcmL8j7D4o9FRdQgCBiz+285o60gQhEBuavYfJW214usFenIotYWKjfqHnRWpxr9AkVD ztm/1adON+BiT9lTBY8h0RF7mYhVMEAZKB5xZ2PvuM6RIntI7Qux6pJZ7GFW5l7TrTTB aFqOZiSUPMHr6qNa0MIHo2fzOLOqsWT2aFZ1nBC//DG4Xt9EWVSJFrlXi6ueXQGtvZRH m2xg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a170902f54a00b001aada12d628si8555644plf.585.2023.05.28.17.51.26; Sun, 28 May 2023 17:51:43 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229813AbjE1Wfw (ORCPT + 99 others); Sun, 28 May 2023 18:35:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjE1Wfu (ORCPT ); Sun, 28 May 2023 18:35:50 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E6E2BD for ; Sun, 28 May 2023 15:35:49 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id fd17a03d-fda7-11ed-b972-005056bdfda7; Mon, 29 May 2023 01:35:47 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Mon, 29 May 2023 01:35:46 +0300 To: Herve Codina Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Christophe Leroy , Thomas Petazzoni Subject: Re: [PATCH v4 2/3] iio: potentiometer: Add support for the Renesas X9250 potentiometers Message-ID: References: <20230509160852.158101-1-herve.codina@bootlin.com> <20230509160852.158101-3-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230509160852.158101-3-herve.codina@bootlin.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, May 09, 2023 at 06:08:51PM +0200, Herve Codina kirjoitti: > The Renesas X9250 integrates four digitally controlled potentiometers. > On each potentiometer, the X9250T has a 100 kOhms total resistance and > the X9250U has a 50 kOhms total resistance. ... > +/* > + * Redundant blank line. > + * x9250.c -- Renesas X9250 potentiometers IIO driver Please, no filename in the file itself. It adds an additional burden in case the module will be renamed in the future. > + * Copyright 2023 CS GROUP France > + * > + * Author: Herve Codina > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include ... > + return spi_write_then_read(x9250->spi, txbuf, ARRAY_SIZE(txbuf), NULL, 0); sizeof() suffice. ... > + return spi_write_then_read(x9250->spi, txbuf, ARRAY_SIZE(txbuf), val, 1); Ditto. ... > + switch (mask) { > + case IIO_CHAN_INFO_RAW: > + ret = x9250_read8(x9250, X9250_CMD_RD_WCR(ch), &v); > + if (ret) > + return ret; > + *val = v; > + return IIO_VAL_INT; > + > + case IIO_CHAN_INFO_SCALE: > + *val = 1000 * x9250->cfg->kohms; > + *val2 = U8_MAX; > + return IIO_VAL_FRACTIONAL; > + } > + return -EINVAL; Just make it part of default: case. ... > + switch (mask) { > + case IIO_CHAN_INFO_RAW: > + *length = ARRAY_SIZE(range); > + *vals = range; > + *type = IIO_VAL_INT; > + return IIO_AVAIL_RANGE; > + } > + > + return -EINVAL; Same. ... > + if (val > U8_MAX || val < 0) > + return -EINVAL; ERANGE ? ... > + Redundant blank line. > +module_spi_driver(x9250_spi_driver); -- With Best Regards, Andy Shevchenko