Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751617AbbEZIFZ (ORCPT ); Tue, 26 May 2015 04:05:25 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:50677 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751364AbbEZIFX (ORCPT ); Tue, 26 May 2015 04:05:23 -0400 Date: Tue, 26 May 2015 10:05:16 +0200 From: Sascha Hauer To: James Liao Cc: Matthias Brugger , Mike Turquette , Stephen Boyd , srv_heupstream@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Kurtz , Ricky Liang , Rob Herring , linux-mediatek@lists.infradead.org, Henry Chen , Sascha Hauer , Yingjoe Chen , Eddie Huang , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 5/5] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS Message-ID: <20150526080516.GG6325@pengutronix.de> References: <1432192376-6712-1-git-send-email-jamesjj.liao@mediatek.com> <1432192376-6712-6-git-send-email-jamesjj.liao@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432192376-6712-6-git-send-email-jamesjj.liao@mediatek.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:58:08 up 70 days, 19:50, 109 users, load average: 0.18, 0.28, 0.38 User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1902 Lines: 64 On Thu, May 21, 2015 at 03:12:56PM +0800, James Liao wrote: > Add REF2USB_TX clock support into MT8173 APMIXEDSYS. This clock > is needed by USB 3.0. > > + > +static struct clk *mtk_clk_register_ref2usb_tx(const char *name, > + void __iomem *reg) > +{ > + struct mtk_ref2usb_tx *tx; > + struct clk_init_data init = {}; > + struct clk *clk; > + const char *parent_name = "clk26m"; > + > + tx = kzalloc(sizeof(*tx), GFP_KERNEL); > + if (!tx) > + return ERR_PTR(-ENOMEM); > + > + tx->base_addr = reg; > + tx->hw.init = &init; > + > + init.name = name; > + init.ops = &mtk_ref2usb_tx_ops; > + init.parent_names = &parent_name; > + init.num_parents = 1; > + > + clk = clk_register(NULL, &tx->hw); > + > + if (IS_ERR(clk)) { > + pr_err("Failed to register clk %s: %ld\n", name, PTR_ERR(clk)); > + kfree(tx); > + } > + > + return clk; > +} > + > +static void __init mtk_clk_register_apmixedsys_special(struct device_node *node, > + struct clk_onecell_data *clk_data) > +{ > + void __iomem *base; > + struct clk *clk; > + > + base = of_iomap(node, 0); > + if (!base) { > + pr_err("%s(): ioremap failed\n", __func__); > + return; > + } > + > + clk = mtk_clk_register_ref2usb_tx("ref2usb_tx", base + 0x8); The function seems to be for one special clock only. Why do you pass the name to it? They will never be called with another name, right? Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- 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/