Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3368166ybb; Tue, 31 Mar 2020 03:57:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt2BV7LuoVp5wBhFRYcgtlzWuS5ByWI25xjeoT90JFOGo/ozcRetpYNokSJ6QXiLXeyltpf X-Received: by 2002:a05:6808:abc:: with SMTP id r28mr1607386oij.161.1585652229309; Tue, 31 Mar 2020 03:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585652229; cv=none; d=google.com; s=arc-20160816; b=Bz0SxEvS+2gh/I5lUxMIKVuZuR5c4ISGw8Z7yTvnFVUBBK84qldmfHs7q/SwkDovGZ JMEXrdfNKiP3CoyMpy7zhDsTBnvrhbVri1C5WLT5FZyD8U/gCVSjZBSjVlrrwF7FGifO C+a7Si8HD7kM3iQvIkfD5qfTZMee2qGOIiM0XE/X5M63j+MkZpNE/4HWVlAVpJVGeys1 Yh3/D1KFPJaczVJ589RuIcLRm4ZD0TKk5qZtuLElmUQtBudz3Auy/T6SuPm4taJUpOzh Uf06pLm5W34HFZEss6Toi1GsDLExzXwsoe1dUlOUipyMLgAV7mxUejw9CFoksgZFm5VN BsVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UTtHrNU5LzWuuToKx4rO2ORYgVK3pfVrzoDsMYbSSFk=; b=o7VPEtrmSjnPkXi1PkcaGsHCLTxiK/ivb+BqM3HiYSfx1H95gqoSHU41mlqR7vWJFF DOHh0uYZILAJeoRnkKe5Q3Qq9ki45GFeolIxN+u3HiMu0cQukI6OUCfz6G7ALXHfaywN CweHk1S3M8T3hVNImb5694GsiitvZGFZT1EkfclOtUukJY2cjZvMaa6pxOBS5PuEhKv8 thhehuGioRokz7LGgBXDSJxHBcRzE9XL4oCCzVh05Hf90U3a1bqfr8lX+kJZF18Kap3i 6HFKDpELApjIIlZgY5nemy+J24cBY2ZhQNfwoJOMx0RZHq8+00Aljqb68aTzdADUg1CI xcLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t6w3POTN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si7279659oov.44.2020.03.31.03.56.57; Tue, 31 Mar 2020 03:57:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t6w3POTN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730507AbgCaK4l (ORCPT + 99 others); Tue, 31 Mar 2020 06:56:41 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36680 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730410AbgCaK4l (ORCPT ); Tue, 31 Mar 2020 06:56:41 -0400 Received: by mail-pg1-f193.google.com with SMTP id c23so1797919pgj.3; Tue, 31 Mar 2020 03:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UTtHrNU5LzWuuToKx4rO2ORYgVK3pfVrzoDsMYbSSFk=; b=t6w3POTN/j3iSn5Qw6KJGzuBljRD/rguLo5r2495D3BfxURl+HxCLhInI88NWTIwCd jkrbsfXef3vzpZgmIXHHPYheHwHPSmkpLxApYEaVW5wRSV4BWIl+Xvxx4+cowVVlF/hK whbiMArrCv8m0RW0u5udo0K91mcljCO9N+/a9FdW+EhyO50bEJHhluN5N9GiqRi9+oAd ri/XJji7OiFNKUItD53WTsju6rIUm929C8q/ZgarddZ/lg+ZFkssBgkngtw4+ujDBzl6 WxluL7t/yRGTHd8/Tc71L6sSJ6nEi2YLtszzWlGJEOS/Vuyk9qZRkKzNPm4m0lgsuYKL 7vuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UTtHrNU5LzWuuToKx4rO2ORYgVK3pfVrzoDsMYbSSFk=; b=rl9DmwNS5LKdOWwJmRF4smVWWQuCVDNw7ORqUP1AXlLOsSGYsui7C7YfYZ3ObPyxsB uGIYbD+OEPGrEuEuD12+LKhPjVQ5PB/4cZ9DOTdxN5GsO9E1lfO6mtRqsD9bjDD3Ucii 6xz9CbIw+6x1CiXuEqxRtKS03kIkC6JOkLzT6ztdCqjVSBO0VRJcbIAfpGPDuEoQTUqY rgP4jEx+Ah1BZqCu1xNLomGaS5juaB07nsrbWJTwS/WTLuIcfs0q2xlWhoFvU0ybs4ui PsuF2vPh9MgkyPQaoECWqfpVbYZ/JAQyLu1C65DNy0A8Tj9j5UlkOVUIpCoFaH7R2sW0 dHbA== X-Gm-Message-State: AGi0PuZgx7Ly3qwSC3eWBsMlKdPVDmct+O9aGIErBuOPigRt+0BDdrxq 1iQTEc5pdfjvuJj0YMqqWmLBNdJ8UKZ3ZE57RB4= X-Received: by 2002:a63:7b1d:: with SMTP id w29mr3546845pgc.4.1585652199992; Tue, 31 Mar 2020 03:56:39 -0700 (PDT) MIME-Version: 1.0 References: <20200317135649.8876-1-michael.auchter@ni.com> <20200317145113.12413-1-michael.auchter@ni.com> <20200330201243.GA22106@xaphan> In-Reply-To: <20200330201243.GA22106@xaphan> From: Andy Shevchenko Date: Tue, 31 Mar 2020 13:56:32 +0300 Message-ID: Subject: Re: Re: [PATCH v2 1/2] iio: adc: ad7291: convert to device tree To: Michael Auchter Cc: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Liam Girdwood , Mark Brown , Linux Kernel Mailing List , linux-iio Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 30, 2020 at 11:12 PM Michael Auchter wrote: > On Sun, Mar 22, 2020 at 01:46:21AM +0200, Andy Shevchenko wrote: > > On Tue, Mar 17, 2020 at 4:53 PM Michael Auchter wrote: ... > > > + chip->reg = devm_regulator_get_optional(&client->dev, "vref"); > > > + if (!IS_ERR(chip->reg)) { > > > > Why not to go with usual positive conditional? > > I took this pattern from ad7266.c which Lars pointed me to. I agree that > a positive conditional here would probably be more natural. I'll change > that if you'd prefer. Yes, please do. ... > > > + .of_match_table = of_match_ptr(ad7291_of_match), > > > > No need to use of_match_ptr(). Haven't you got a compiler warning in !OF case? > > Hm, no warning as far as I can see with !OF... Have you used `make W=1 ...`? With it you should get a warning that table defined but not used. > but agreed that this > doesn't make much sense as-is. > > Is dropping of_match_ptr() the preferred route here? The driver doesn't > depend on OF, so it seems like keeping of_match_ptr and instead guarding > the ad7291_of_match table with #ifdef CONFIG_OF would be preferred. Of > course, maybe that's not worth it for saving some bytes from the final > image. You need either both (of_match_ptr() _and_ ugly ifdeffery, and note you will need of.h for that) or none (mod_devicetable.h maybe needed, though). > Let me know which route would be preferred. If we would like to use this in non-DT environment, then drop all that OF-specific stuff. -- With Best Regards, Andy Shevchenko