From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A01FC2BB1D for ; Fri, 13 Mar 2020 07:47:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B00C20409 for ; Fri, 13 Mar 2020 07:47:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ef5CVmT7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B00C20409 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X94wB9th3Y5bgMwYx/jbzT9Gh7CxZsgl1FsGUW6XbWI=; b=ef5CVmT7oYRcgp 8nM4bKAxv02MUjUnjmb+v8sTWsUn7F9j38fzZgUB07EY1A1WNF42Tu9BILOrDplyM+X5KP74lJzGF jcNtPTaijYlZs6ITIXoPQdSYrmv0uz/WpfKH+MRS3JyudChfeE8g2C1wcfAOdUx7uIRgEK1OEg0uX crTMDOKw91amuRCYeb8qEVadtSrHRoTSA5Jdv4tybkha2jScRXUeFeBvj84EXI8hPqzl0ZF3qediJ BEZmbYXtlyFCz0eddl4IhOVk+Y7YMHqlbc6GzEAsqhqO1b6zWtHOpJLQLG8jTYmlQcaLJjrcBPq1c b2KUQ3m0XIxElHCCHgnw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCf2t-0006Li-OF; Fri, 13 Mar 2020 07:47:51 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jCf2i-0006Eb-UE; Fri, 13 Mar 2020 07:47:43 +0000 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 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-Disposition: inline In-Reply-To: <20200313072230.GC3142@dell> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200313_004741_129359_B7D10170 X-CRM114-Status: GOOD ( 15.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Alessandro Zummo , Josef Friedl , Nicolas Boichat , srv_heupstream@mediatek.com, Frank Wunderlich , Ran Bi , Sean Wang , Sebastian Reichel , linux-kernel@vger.kernel.org, Richard Fontana , devicetree@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, Matthias Brugger , Thomas Gleixner , Eddie Huang , Hsin-Hsiung Wang , linux-rtc@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel