Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbbG1EGA (ORCPT ); Tue, 28 Jul 2015 00:06:00 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:41137 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752025AbbG1EF6 (ORCPT ); Tue, 28 Jul 2015 00:05:58 -0400 X-Listener-Flag: 11101 Message-ID: <1438056355.17770.9.camel@mtksdaap41> Subject: Re: [PATCH v4 6/7] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS From: James Liao To: Daniel Kurtz CC: Matthias Brugger , Mike Turquette , Stephen Boyd , "Heiko Stubner" , srv_heupstream , Ricky Liang , Rob Herring , Sascha Hauer , "open list:OPEN FIRMWARE AND..." , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Date: Tue, 28 Jul 2015 12:05:55 +0800 In-Reply-To: References: <1437706925-3222-1-git-send-email-jamesjj.liao@mediatek.com> <1437706925-3222-7-git-send-email-jamesjj.liao@mediatek.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1716 Lines: 59 Hi Daniel, On Fri, 2015-07-24 at 19:28 +0800, Daniel Kurtz wrote: > On Fri, Jul 24, 2015 at 11:02 AM, James Liao wrote: > > +struct clk *mtk_clk_register_ref2usb_tx(const char *name, > > + const char *parent_name, void __iomem *reg) > > struct clk * __init mtk_clk_register_ref2usb_tx( It will be added in next patch. > > > > #include > > #include > > -#include > > -#include > > nit: this looks like an unrelated change that can be in its own patch. It will be in a separated patch. > > > > +typedef struct clk *(*mtk_clk_register_ex)(const char *, const char *, > > + void __iomem *); > > + > > +struct mtk_clk_ex { > > + int id; > > + const char *name; > > + const char *parent; > > + u32 reg_ofs; > > + mtk_clk_register_ex reg_clk_ex; > > > This "mtk_clk_ex" abstraction seems unnecessarily complicated for a > one-off USB clock. > Just call mtk_clk_register_ref2usb_tx() directly from mtk_apmixedsys_init(). Use a table to associate related constants and names is more readable, such as: APMIXED_EX(CLK_APMIXED_REF2USB_TX, "ref2usb_tx", ... If we call mtk_clk_register_ref2usb_tx() directly, it will be: clk = mtk_clk_register_ref2usb_tx("ref2usb_tx", ...); clk_data-clks[CLK_APMIXED_REF2USB_TX] = clk; Do you prefer the last one? Best regards, James -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/