Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5605309rwd; Wed, 24 May 2023 04:27:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76xzLt2ub6N34f/dD9kj9Rh0bKOjGIrlINDhEOlU8XxAPTbzhvY+dyxR5z0tqd3UkAhaky X-Received: by 2002:a17:902:7287:b0:1a9:8ba4:d0d3 with SMTP id d7-20020a170902728700b001a98ba4d0d3mr15776696pll.8.1684927648659; Wed, 24 May 2023 04:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684927648; cv=none; d=google.com; s=arc-20160816; b=rMa9+J/jN7KPpneeEEBugahpdE+Y2xKpbZ67GvFgsJ2YWwHeqaHwxdl2jInSHTjv7L jhM790C4/oC7cCPs3ynVlL6lCnVbkfKnq3HljUMRw44RVEUinDurI4VXcZHpV1o5e4MF olHs0NYK2IM80CSxUVkWLAY0UKBuTKJi7goDVk2PH5awa/uRAhquhvOofKSgwqUGQXGI /GW4O0mV8GqkHAKFcdTcQ83iE9sEFowNkF6jEaECoQXOY/c1mpxduLk8chLX+BZctpEW uzXs2JhNeBCKPWz3kDsufBJ9qmajI1Mr3GlkPXl6SnQmljiIcu3MU7N/hiXR4QdZK1zL G8YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fEu927JJ+mhxkXQiMO+Ybx2esYaoKkEnefJLxanZAIo=; b=r7bOtHOneCAw75KoASyG4fz+4vPxN4S6lUpC9ZnPKabtgHG/q0LBN58zT6sPerQqts GyGbjjn3+/teyZoEMrp7o+kkbgOUJap+ndE745kjRhDsQ/z861vb/0Eo11tYDxz2CFCD octkTfFFKzOUQARhIj7rghNq3EsBAgH0p84/LnFfU6RDECX0uIYhSAcUEhGGvEh1l6HL 1jEC3850q9P0Emtu7W1yVMBmVEukCxY6b++dombhtiSvc75AJS1/Paf9zKaW+q0IsWZ4 JiCIHdGqgLacp81RrT4He4iNuGYa6bCp9/essZ1I7rDmxu12ejZCPdMelkXsDL6CcxiE kHng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fOsP8243; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020a170902b7c400b001aaebc66877si6295842plz.147.2023.05.24.04.27.13; Wed, 24 May 2023 04:27:28 -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=@intel.com header.s=Intel header.b=fOsP8243; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234643AbjEXLHa (ORCPT + 99 others); Wed, 24 May 2023 07:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234708AbjEXLHX (ORCPT ); Wed, 24 May 2023 07:07:23 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40217195; Wed, 24 May 2023 04:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684926434; x=1716462434; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=dwI8xxMEjunWpxl7fD4Qdm430ndHRu9GRBnfhcyQF7o=; b=fOsP82439wQlE8vLPIMzXe1hf4+A3OCXQUX409Nf5OkZnlQkdtbNqpsr Sxn890TOchKEBaA5u9kgDk7G6ZGz81MoSaCkc4eNjpF9nA98OeGHFl0kw CadqXN3qOusHdLeeQQZtcNd9QrxfCtoe8uhhkstFzNf17L+iT/8txnnW+ FCHUDDYlvhfWnaJ9iyl7Zugbjwmdwe+hWT8v2tmZeD4g4gdRoFY8pgrWr b9HEJ9GcSKyjPTq+8o4Hq9292/Dox5UTNSfsEH1wN5l2MjRN8ntk43AjV GfYu/y/LZeiZSCDK/pv0TBpT1vgDJgQmGcoPtU2JYJrgjduxryEWoxt7+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="353555542" X-IronPort-AV: E=Sophos;i="6.00,189,1681196400"; d="scan'208";a="353555542" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 04:07:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10719"; a="774201652" X-IronPort-AV: E=Sophos;i="6.00,189,1681196400"; d="scan'208";a="774201652" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 24 May 2023 04:06:58 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1q1mKW-000GEH-01; Wed, 24 May 2023 14:06:56 +0300 Date: Wed, 24 May 2023 14:06:55 +0300 From: Andy Shevchenko To: Andre Przywara Cc: Maxim Kiselev , linux-iio@vger.kernel.org, Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Cosmin Tanislav , Haibo Chen , ChiYuan Huang , Ramona Bolboaca , Ibrahim Tilki , ChiaEn Wu , William Breathitt Gray , Arnd Bergmann , AngeloGioacchino Del Regno , Caleb Connolly , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [RFC PATCH v1 1/4] iio: adc: Add Allwinner D1/T113s/R329 SoCs GPADC Message-ID: References: <20230524082744.3215427-1-bigunclemax@gmail.com> <20230524082744.3215427-2-bigunclemax@gmail.com> <20230524110105.4928906c@donnerap.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230524110105.4928906c@donnerap.cambridge.arm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Wed, May 24, 2023 at 11:01:05AM +0100, Andre Przywara wrote: > On Wed, 24 May 2023 11:27:30 +0300 > Maxim Kiselev wrote: ... > > +static const struct regmap_config sun20i_gpadc_regmap_config = { > > + .reg_bits = 32, > > + .val_bits = 32, > > + .reg_stride = 4, > > + .fast_io = true, > > +}; > > Is there any particular reason you chose a regmap to model this here? > Isn't that just straight-forward MMIO, which we could just drive using > readl()/writel()? Even though regmap adds a few nice features that might be used. For example, locking. But I dunno if this driver actually uses it OR uses it correctly. ... > > + config = of_device_get_match_data(&pdev->dev); Please, avoid using OF-centric APIs in the new IIO drivers. config = device_get_match_data(&pdev->dev); should suffice. > > + if (!config) > > + return -ENODEV; ... > > + irq = platform_get_irq(pdev, 0); > > + if (irq < 0) > > + return dev_err_probe(&pdev->dev, irq, "failed to get irq\n"); We should not repeat the message that printed by platform core. ... > > + ret = devm_request_irq(&pdev->dev, irq, sun20i_gpadc_irq_handler, > > + 0, dev_name(&pdev->dev), info); You can simplify your life with struct device *dev = &pdev->dev; at the definition block of the function. > > + if (ret < 0) > > + return dev_err_probe(&pdev->dev, ret, > > + "failed requesting irq %d\n", irq); ... > > + .data = &sun20i_d1_gpadc_channels[1] Also, leave comma here. ... > > + .data = &sun50i_r329_gpadc_channels[2] Same as above. -- With Best Regards, Andy Shevchenko