Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1427069ybh; Fri, 13 Mar 2020 00:48:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuywbIHNvcmWiBXkEakQ6NA4k14+gfQSUUgbvRaiEFQw2XpXo24Jo1S05NAgjD3DC8GYx7U X-Received: by 2002:a05:6830:1e09:: with SMTP id s9mr9338670otr.149.1584085728327; Fri, 13 Mar 2020 00:48:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584085728; cv=none; d=google.com; s=arc-20160816; b=VOLEJPZtudoGs5RBfICpd8IYzHekBK3oe0m2r/82t4pllm2aH+MHbiKQf27Ns48qyb a007j7SXS25JfKakqVC1XlhywDF0yasvAyvVoSz4wmYCtD1cumqriW3v1PAOvL71ICoV 3lajTA2lhqWZFrwT34jC+eUwl0zXbMVuXRx0PDp3zfuz6FXOzeO6C6gKcR52V9ArwQwR RQz2mnIGJlTQQavhTKn8dqDp/wKtxqXKzuvkw0XVa6ZGzfUO8O4RVH4NBKBJqZE8nbaC DNzJ1mdT1eqN02TV57ySQYEsSOeVLIzIgr098vO40MNn13KPShVkJRRCR5tTVBCU0+F6 6H4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=KbivofxXO0fZpMynqU48r5Ach9vmtmzsMHuRU9WQXDA=; b=kXn2UAIX/Y2w4pAHsvALBqK6CZmL4df1vKpTB8x/xlW+xzst001a51PGkyEKxczsgo ZbiZ7idmMwK3F1WSZljmSRw/MZuBGw0fBIzVMzNV2QxgVUe0h/fzWXPB6KdC+f0eW5Il QscNVSFIj/8bQubfX+pncaCqOwLU3RwIAnpbASsr3SCpZF95WvE7Fk9O1QjcsTDWDh/q rRbB+sEi53YZcAzV4X2Bq6WzwbRFQQw5JJUWrZZiAjKmmhabNjktOiRKXc9oBzn+Pk+p nSP75rawdSZaohIrYQ4b/Xw4TENI4Y0W9hjq0zghY9TTgY51+zGK8EdR3xCNr2YZ28+T 9BNQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si4177353otr.322.2020.03.13.00.48.35; Fri, 13 Mar 2020 00:48:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726393AbgCMHrj (ORCPT + 99 others); Fri, 13 Mar 2020 03:47:39 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:52643 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbgCMHrj (ORCPT ); Fri, 13 Mar 2020 03:47:39 -0400 Received: from localhost (lfbn-lyo-1-9-35.w86-202.abo.wanadoo.fr [86.202.105.35]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id CE83E100010; Fri, 13 Mar 2020 07:47:34 +0000 (UTC) Date: Fri, 13 Mar 2020 08:47:34 +0100 From: Alexandre Belloni To: Lee Jones Cc: Ran Bi , Hsin-Hsiung Wang , Rob Herring , Matthias Brugger , Mark Rutland , Sean Wang , Sebastian Reichel , Eddie Huang , Alessandro Zummo , Frank Wunderlich , Thomas Gleixner , Richard Fontana , Josef Friedl , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, Nicolas Boichat , srv_heupstream@mediatek.com Subject: Re: [PATCH v10 4/5] rtc: mt6397: Add support for the MediaTek MT6358 RTC Message-ID: <20200313074734.GD3384@piout.net> References: <1583918223-22506-1-git-send-email-hsin-hsiung.wang@mediatek.com> <1583918223-22506-5-git-send-email-hsin-hsiung.wang@mediatek.com> <20200312074407.GA3142@dell> <1584003477.6269.8.camel@mhfsdcap03> <20200313072230.GC3142@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200313072230.GC3142@dell> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/03/2020 07:22:30+0000, Lee Jones wrote: > > > > struct mt6397_rtc { > > > > struct device *dev; > > > > struct rtc_device *rtc_dev; > > > > @@ -74,6 +80,7 @@ struct mt6397_rtc { > > > > struct regmap *regmap; > > > > int irq; > > > > u32 addr_base; > > > > + const struct mtk_rtc_data *data; > > > > > > 'data' is a terrible variable name. > > > > > > Why do you need to store this? > > > > > > It's one variable which is used once AFAICT. > > > > I would rename 'data' to 'config'. > > > > This struct will be extended in future patches to achieve more PMIC chip > > compatibility. > > On closer inspection, it looks like wrtgr (also not a great name for a > variable by the way) is a register address. Is that correct? > Initially I thought it was a model number, which would have been a > suitable candidate for entry into OF .data. > > However, describing register addresses in OF .data does not sound like > good practice. It is usually used to identify a platform in the cases > where platforms cannot be otherwise dynamically interrogated for model > number via a register read. > > Describing register maps via 'config' data is a slippery slope. I'm not sure I get what you mean, there are dozens if not hundreds of drivers doing it exactly that way. What is the difference between having .data pointing to a register map and having .data containing a model number and then use that model number to get the register map? of_device_id::data definitively isn't config data as the DT describes the hardware, not the configuration. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com