From patchwork Tue Mar 3 10:25:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 5921031 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B55A99F318 for ; Tue, 3 Mar 2015 10:25:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0302202B4 for ; Tue, 3 Mar 2015 10:25:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5205320125 for ; Tue, 3 Mar 2015 10:25:49 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B581C2612C7; Tue, 3 Mar 2015 11:25:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C98A42608C7; Tue, 3 Mar 2015 11:25:39 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id EFF5D2608CF; Tue, 3 Mar 2015 11:25:37 +0100 (CET) Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by alsa0.perex.cz (Postfix) with ESMTP id 352E42606CB for ; Tue, 3 Mar 2015 11:25:32 +0100 (CET) Received: by mail.free-electrons.com (Postfix, from userid 106) id 0BA3639B; Tue, 3 Mar 2015 11:25:30 +0100 (CET) Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5D03038D; Tue, 3 Mar 2015 11:25:20 +0100 (CET) Date: Tue, 3 Mar 2015 11:25:19 +0100 From: Thomas Petazzoni To: Russell King Message-ID: <20150303112519.557f43ad@free-electrons.com> In-Reply-To: References: <20150302170538.GQ8656@n2100.arm.linux.org.uk> Organization: Free Electrons X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Cc: Andrew Lunn , alsa-devel@alsa-project.org, Jason Cooper , linux-sh@vger.kernel.org, Sebastian Hesselbarth , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: Re: [alsa-devel] [PATCH 08/10] ARM: orion: use clkdev_create() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Dear Russell King, On Mon, 02 Mar 2015 17:06:42 +0000, Russell King wrote: > clkdev_create() is a shorter way to write clkdev_alloc() followed by > clkdev_add(). Use this instead. > > Signed-off-by: Russell King > --- > arch/arm/plat-orion/common.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c > index f5b00f41c4f6..2235081a04ee 100644 > --- a/arch/arm/plat-orion/common.c > +++ b/arch/arm/plat-orion/common.c > @@ -28,11 +28,7 @@ > void __init orion_clkdev_add(const char *con_id, const char *dev_id, > struct clk *clk) > { > - struct clk_lookup *cl; > - > - cl = clkdev_alloc(clk, con_id, dev_id); > - if (cl) > - clkdev_add(cl); > + clkdev_create(clk, con_id, "%s", dev_id); > } > > /* Create clkdev entries for all orion platforms except kirkwood. Looks good, but instead of having orion_clkdev_add() being just an alias for clkdev_create(), what about going ahead and simply reoving orion_clkdev_add() entirely? Something like the below patch (not even compile tested) : diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 0d1a892..ec00183 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c @@ -109,28 +109,28 @@ static void __init dove_clk_init(void) gephy = dove_register_gate("gephy", "tclk", CLOCK_GATING_BIT_GIGA_PHY); ge = dove_register_gate("ge", "gephy", CLOCK_GATING_BIT_GBE); - orion_clkdev_add(NULL, "orion_spi.0", tclk); - orion_clkdev_add(NULL, "orion_spi.1", tclk); - orion_clkdev_add(NULL, "orion_wdt", tclk); - orion_clkdev_add(NULL, "mv64xxx_i2c.0", tclk); - - orion_clkdev_add(NULL, "orion-ehci.0", usb0); - orion_clkdev_add(NULL, "orion-ehci.1", usb1); - orion_clkdev_add(NULL, "mv643xx_eth_port.0", ge); - orion_clkdev_add(NULL, "sata_mv.0", sata); - orion_clkdev_add("0", "pcie", pex0); - orion_clkdev_add("1", "pcie", pex1); - orion_clkdev_add(NULL, "sdhci-dove.0", sdio0); - orion_clkdev_add(NULL, "sdhci-dove.1", sdio1); - orion_clkdev_add(NULL, "orion_nand", nand); - orion_clkdev_add(NULL, "cafe1000-ccic.0", camera); - orion_clkdev_add(NULL, "mvebu-audio.0", i2s0); - orion_clkdev_add(NULL, "mvebu-audio.1", i2s1); - orion_clkdev_add(NULL, "mv_crypto", crypto); - orion_clkdev_add(NULL, "dove-ac97", ac97); - orion_clkdev_add(NULL, "dove-pdma", pdma); - orion_clkdev_add(NULL, MV_XOR_NAME ".0", xor0); - orion_clkdev_add(NULL, MV_XOR_NAME ".1", xor1); + clkdev_create(tclk, NULL, "%s", "orion_spi.0"); + clkdev_create(tclk, NULL, "%s", "orion_spi.1"); + clkdev_create(tclk, NULL, "%s", "orion_wdt"); + clkdev_create(tclk, NULL, "%s", "mv64xxx_i2c.0"); + + clkdev_create(usb0, NULL, "%s", "orion-ehci.0"); + clkdev_create(usb1, NULL, "%s", "orion-ehci.1"); + clkdev_create(ge, NULL, "%s", "mv643xx_eth_port.0"); + clkdev_create(sata, NULL, "%s", "sata_mv.0"); + clkdev_create(pex0, "0", "%s", "pcie"); + clkdev_create(pex1, "1", "%s", "pcie"); + clkdev_create(sdio0, NULL, "%s", "sdhci-dove.0"); + clkdev_create(sdio1, NULL, "%s", "sdhci-dove.1"); + clkdev_create(nand, NULL, "%s", "orion_nand"); + clkdev_create(camera, NULL, "%s", "cafe1000-ccic.0"); + clkdev_create(i2s0, NULL, "%s", "mvebu-audio.0"); + clkdev_create(i2s1, NULL, "%s", "mvebu-audio.1"); + clkdev_create(crypto, NULL, "%s", "mv_crypto"); + clkdev_create(ac97, NULL, "%s", "dove-ac97"); + clkdev_create(pdma, NULL, "%s", "dove-pdma"); + clkdev_create(xor0, NULL, "%s", MV_XOR_NAME ".0"); + clkdev_create(xor1, NULL, "%s", MV_XOR_NAME ".1"); } /***************************************************************************** diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index f5b00f4..6ac3549 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c @@ -24,31 +24,20 @@ #include #include -/* Create a clkdev entry for a given device/clk */ -void __init orion_clkdev_add(const char *con_id, const char *dev_id, - struct clk *clk) -{ - struct clk_lookup *cl; - - cl = clkdev_alloc(clk, con_id, dev_id); - if (cl) - clkdev_add(cl); -} - /* Create clkdev entries for all orion platforms except kirkwood. Kirkwood has gated clocks for some of its peripherals, so creates its own clkdev entries. For all the other orion devices, create clkdev entries to the tclk. */ void __init orion_clkdev_init(struct clk *tclk) { - orion_clkdev_add(NULL, "orion_spi.0", tclk); - orion_clkdev_add(NULL, "orion_spi.1", tclk); - orion_clkdev_add(NULL, MV643XX_ETH_NAME ".0", tclk); - orion_clkdev_add(NULL, MV643XX_ETH_NAME ".1", tclk); - orion_clkdev_add(NULL, MV643XX_ETH_NAME ".2", tclk); - orion_clkdev_add(NULL, MV643XX_ETH_NAME ".3", tclk); - orion_clkdev_add(NULL, "orion_wdt", tclk); - orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", tclk); + clkdev_create(tclk, NULL, "%s", "orion_spi.0"); + clkdev_create(tclk, NULL, "%s", "orion_spi.1"); + clkdev_create(tclk, NULL, "%s", MV643XX_ETH_NAME ".0"); + clkdev_create(tclk, NULL, "%s", MV643XX_ETH_NAME ".1"); + clkdev_create(tclk, NULL, "%s", MV643XX_ETH_NAME ".2"); + clkdev_create(tclk, NULL, "%s", MV643XX_ETH_NAME ".3"); + clkdev_create(tclk, NULL, "%s", "orion_wdt"); + clkdev_create(tclk, NULL, "%s", MV64XXX_I2C_CTLR_NAME ".0"); } /* Fill in the resources structure and link it into the platform diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h index d9a24f6..7a06b6b 100644 --- a/arch/arm/plat-orion/include/plat/common.h +++ b/arch/arm/plat-orion/include/plat/common.h @@ -106,8 +106,5 @@ void __init orion_crypto_init(unsigned long mapbase, unsigned long sram_size, unsigned long irq); -void __init orion_clkdev_add(const char *con_id, const char *dev_id, - struct clk *clk); - void __init orion_clkdev_init(struct clk *tclk); #endif