Remove asm/clkdev.h and privatize __clk{get,put}()
Subsystems (24)
cover Remove asm/clkdev.h and privatize __clk{get,put}()
These patches remove the asm-generic/clkdev.h header file and fold it into the linux/clkdev.h file.
I'd like to merge this into the clk tree for the upcoming merge window, so please ack if things look good. The later patches
I also want to drop the slab.h include from clkdev.h, but that will require including slab.h in various files that are relying on the implicit include in clkdev.h right now. Here's that list of files that don't include slab.h but include clkdev.h for the interested folks.
arch/arm/mach-davinci/clock.harch/arm/mach-davinci/da850.carch/arm/mach-ep93xx/clock.carch/arm/mach-highbank/highbank.carch/arm/mach-imx/mach-imx53.carch/arm/mach-imx/mach-imx6q.carch/arm/mach-mmp/clock.harch/arm/mach-mxs/mach-mxs.carch/arm/mach-nspire/nspire.carch/arm/mach-omap1/board-nokia770.carch/arm/mach-omap1/clock.carch/arm/mach-omap1/clock.harch/arm/mach-omap2/clock.harch/arm/mach-pxa/eseries.carch/arm/mach-pxa/pxa27x.carch/arm/mach-pxa/tosa.carch/arm/mach-sa1100/clock.carch/arm/mach-w90x900/clock.harch/arm/plat-orion/common.carch/blackfin/mach-bf609/clock.carch/c6x/kernel/setup.carch/c6x/platforms/pll.carch/c6x/platforms/plldata.carch/mips/ath79/clock.carch/mips/bcm63xx/clk.carch/mips/lantiq/clk.carch/mips/lantiq/clk.harch/mips/lantiq/falcon/sysctrl.carch/mips/lantiq/xway/sysctrl.carch/mips/ralink/clk.carch/powerpc/platforms/512x/clock-commonclk.carch/sh/boards/mach-highlander/setup.carch/sh/boards/mach-sdk7786/setup.carch/sh/kernel/cpu/sh2a/clock-sh7264.carch/sh/kernel/cpu/sh2a/clock-sh7269.carch/sh/kernel/cpu/sh4/clock-sh4-202.carch/sh/kernel/cpu/sh4a/clock-sh7343.carch/sh/kernel/cpu/sh4a/clock-sh7366.carch/sh/kernel/cpu/sh4a/clock-sh7722.carch/sh/kernel/cpu/sh4a/clock-sh7723.carch/sh/kernel/cpu/sh4a/clock-sh7724.carch/sh/kernel/cpu/sh4a/clock-sh7734.carch/sh/kernel/cpu/sh4a/clock-sh7757.carch/sh/kernel/cpu/sh4a/clock-sh7763.carch/sh/kernel/cpu/sh4a/clock-sh7780.carch/sh/kernel/cpu/sh4a/clock-sh7785.carch/sh/kernel/cpu/sh4a/clock-sh7786.carch/sh/kernel/cpu/sh4a/clock-shx3.cdrivers/acpi/acpi_amba.cdrivers/acpi/acpi_apd.cdrivers/acpi/acpi_lpss.cdrivers/clk/at91/clk-generated.cdrivers/clk/at91/clk-h32mx.cdrivers/clk/at91/clk-main.cdrivers/clk/at91/clk-master.cdrivers/clk/at91/clk-peripheral.cdrivers/clk/at91/clk-pll.cdrivers/clk/at91/clk-plldiv.cdrivers/clk/at91/clk-programmable.cdrivers/clk/at91/clk-slow.cdrivers/clk/at91/clk-smd.cdrivers/clk/at91/clk-system.cdrivers/clk/at91/clk-usb.cdrivers/clk/at91/clk-utmi.cdrivers/clk/at91/pmc.cdrivers/clk/at91/sckc.cdrivers/clk/bcm/clk-cygnus.cdrivers/clk/bcm/clk-iproc-asiu.cdrivers/clk/bcm/clk-iproc-pll.cdrivers/clk/clk-asm9260.cdrivers/clk/clk-moxart.cdrivers/clk/clk-s2mps11.cdrivers/clk/clk-xgene.cdrivers/clk/clkdev.cdrivers/clk/imx/clk-imx1.cdrivers/clk/imx/clk-imx21.cdrivers/clk/imx/clk-imx25.cdrivers/clk/imx/clk-imx27.cdrivers/clk/imx/clk-imx31.cdrivers/clk/imx/clk-imx35.cdrivers/clk/imx/clk-imx51-imx53.cdrivers/clk/imx/clk-imx6q.cdrivers/clk/imx/clk-imx6sl.cdrivers/clk/imx/clk-imx6sx.cdrivers/clk/imx/clk-imx6ul.cdrivers/clk/imx/clk-imx7d.cdrivers/clk/loongson1/clk-loongson1b.cdrivers/clk/loongson1/clk-loongson1c.cdrivers/clk/microchip/clk-pic32mzda.cdrivers/clk/mmp/clk.hdrivers/clk/mxs/clk-imx28.cdrivers/clk/pxa/clk-pxa.cdrivers/clk/pxa/clk-pxa25x.cdrivers/clk/pxa/clk-pxa27x.cdrivers/clk/pxa/clk-pxa3xx.cdrivers/clk/renesas/clk-emev2.cdrivers/clk/renesas/clk-mstp.cdrivers/clk/rockchip/clk-rockchip.cdrivers/clk/sirf/clk-atlas6.cdrivers/clk/sirf/clk-prima2.cdrivers/clk/spear/spear1310_clock.cdrivers/clk/spear/spear1340_clock.cdrivers/clk/spear/spear3xx_clock.cdrivers/clk/spear/spear6xx_clock.cdrivers/clk/sunxi/clk-sun9i-core.cdrivers/clk/tegra/clk-emc.cdrivers/clk/tegra/clk-tegra-periph.cdrivers/clk/tegra/clk-tegra-pmc.cdrivers/clk/tegra/clk-tegra124.cdrivers/clk/tegra/clk-tegra20.cdrivers/clk/tegra/clk-tegra210.cdrivers/clk/tegra/clk-tegra30.cdrivers/clk/tegra/clk.cdrivers/clk/tegra/clk.hdrivers/clk/ti/adpll.cdrivers/clk/ti/clk-44xx.cdrivers/clk/ti/clk-54xx.cdrivers/clk/ti/clk-7xx.cdrivers/clk/ti/clk.cdrivers/clk/ti/dpll3xxx.cdrivers/clk/ux500/abx500-clk.cdrivers/clk/ux500/u8540_clk.cdrivers/clk/versatile/clk-impd1.cdrivers/gpu/ipu-v3/ipu-csi.cdrivers/i2c/busses/i2c-altera.cdrivers/i2c/busses/i2c-axxia.cdrivers/media/platform/atmel/atmel-isc.cdrivers/memory/tegra/tegra124-emc.cdrivers/mfd/intel-lpss.cdrivers/mfd/intel_quark_i2c_gpio.cdrivers/net/ethernet/ti/cpts.hdrivers/pinctrl/pinctrl-lantiq.hdrivers/spi/spi-pic32.cdrivers/staging/board/board.cinclude/linux/clk/ti.hsound/soc/sh/migor.c
Stephen Boyd (5):
blackfin: Use generic clkdev.h header
clk: Prepare to remove asm-generic/clkdev.h
arch: Remove clkdev.h asm-generic from Kbuild
clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks
clk: Move __clk_{get,put}() into private clk.h API
arch/alpha/include/asm/Kbuild | 1 - arch/arc/include/asm/Kbuild | 1 - arch/arm/include/asm/Kbuild | 1 - arch/arm64/include/asm/Kbuild | 1 - arch/blackfin/include/asm/clkdev.h | 17 ----------------- arch/c6x/include/asm/Kbuild | 1 - arch/cris/include/asm/Kbuild | 1 - arch/frv/include/asm/Kbuild | 1 - arch/h8300/include/asm/Kbuild | 1 - arch/hexagon/include/asm/Kbuild | 1 - arch/ia64/include/asm/Kbuild | 1 - arch/m32r/include/asm/Kbuild | 1 - arch/m68k/include/asm/Kbuild | 1 - arch/metag/include/asm/Kbuild | 1 - arch/microblaze/include/asm/Kbuild | 1 - arch/mips/include/asm/Kbuild | 1 - arch/mn10300/include/asm/Kbuild | 1 - arch/nios2/include/asm/Kbuild | 1 - arch/openrisc/include/asm/Kbuild | 1 - arch/parisc/include/asm/Kbuild | 1 - arch/powerpc/include/asm/Kbuild | 1 - arch/riscv/include/asm/Kbuild | 1 - arch/s390/include/asm/Kbuild | 1 - arch/score/include/asm/Kbuild | 1 - arch/sh/include/asm/Kbuild | 1 - arch/sparc/include/asm/Kbuild | 1 - arch/tile/include/asm/Kbuild | 1 - arch/um/include/asm/Kbuild | 1 - arch/unicore32/include/asm/Kbuild | 1 - arch/x86/include/asm/Kbuild | 1 - arch/xtensa/include/asm/Kbuild | 1 - drivers/clk/clk.h | 4 ++++ drivers/clk/clkdev.c | 2 +- drivers/clk/sunxi/clk-factors.c | 26 +++++++++++++++++++++----- drivers/clk/sunxi/clk-factors.h | 4 ++++ drivers/clk/sunxi/clk-mod0.c | 9 ++------- drivers/clk/sunxi/clk-sun8i-mbus.c | 7 ++----- drivers/clk/sunxi/clk-sun9i-core.c | 9 ++------- drivers/clk/sunxi/clk-sunxi.c | 36 +++++++++++++----------------------- include/asm-generic/clkdev.h | 30 ------------------------------ include/linux/clkdev.h | 7 +------ 41 files changed, 50 insertions(+), 131 deletions(-) delete mode 100644 arch/blackfin/include/asm/clkdev.h delete mode 100644 include/asm-generic/clkdev.h
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 1/5 blackfin: Use generic clkdev.h header
The generic header file is equivalent to the blackfin version, so just use the generic one.
--- arch/blackfin/include/asm/Kbuild | 1 + arch/blackfin/include/asm/clkdev.h | 17 ----------------- 2 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 arch/blackfin/include/asm/clkdev.h
arch/blackfin/include/asm/Kbuild +1 -0
@@ -1,4 +1,5 @@ generic-y += bugs.h +generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += div64.h
arch/blackfin/include/asm/clkdev.h deleted +0 -17
@@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_CLKDEV__H_ -#define __ASM_CLKDEV__H_ - -#include <linux/slab.h> - -static inline struct clk_lookup_alloc *__clkdev_alloc (size_t size) -{ -return kzalloc (size,GFP_KERNEL ); -} - -#ifndef CONFIG_COMMON_CLK -#define __clk_put (clk) -#define __clk_get (clk) ({ 1; }) -#endif - -#endif
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Stephen Boyd
AppliedRe: [PATCH 1/5] blackfin: Use generic clkdev.h header
Quoted 5 lines · Stephen Boyd
The generic header file is equivalent to the blackfin version, so just use the generic one.
Signed-off-by Stephen Boyd <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 2/5 clk: Prepare to remove asm-generic/clkdev.h
In reply to Stephen BoydNow that all the users of asm/clkdev.h have been replaced with the generic file we can get rid of the asm-generic file as well and implement that code directly where it's used.
We only have one caller of __clkdev_alloc(), in clkdev.c so we can easily remove that and drop the include of asm/clkdev.h in linux/clkdev.h by putting the __clk_get/__clk_put inlines in their respective location.
--- drivers/clk/clkdev.c | 2 +- include/linux/clkdev.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/clk/clkdev.c +1 -1
@@ -256,7 +256,7 @@ vclkdev_alloc(struct clk_hw *hw, const char *con_id, const char *dev_fmt, {struct clk_lookup_alloc *cla; - cla =__clkdev_alloc (sizeof (*cla)); + cla =kzalloc (sizeof (*cla),GFP_KERNEL );if (!cla)return NULL ;
include/linux/clkdev.h +4 -1
@@ -12,7 +12,7 @@#ifndef __CLKDEV_H#define __CLKDEV_H -#include <asm/clkdev.h> +#include <linux/slab.h> struct clk ;struct clk_hw ;
@@ -55,6 +55,9 @@ int clk_hw_register_clkdev(struct clk_hw *, const char *, const char *);#ifdef CONFIG_COMMON_CLK int __clk_get (struct clk *clk);void __clk_put (struct clk *clk); +#else +static inline int __clk_get (struct clk *clk) {return 1 ; } +static inline void __clk_put (struct clk *clk) { }#endif #endif
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Stephen Boyd
AppliedRe: [PATCH 2/5] clk: Prepare to remove asm-generic/clkdev.h
Quoted 4 lines · Stephen Boyd
Now that all the users of
asm/clkdev.hhave been replaced with the generic file we can get rid of the asm-generic file as well and implement that code directly where it's used.
Quoted 8 lines
We only have one caller of
__clkdev_alloc(), inclkdev.cso we can easily remove that and drop the include ofasm/clkdev.hinlinux/clkdev.hby putting the __clk_get/__clk_put inlines in their respective location.Cc Russell King <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 3/5 arch: Remove clkdev.h asm-generic from Kbuild
In reply to Stephen BoydNow that every architecture is using the generic clkdev.h file and we no longer include asm/clkdev.h anywhere in the tree, we can remove it.
--- arch/alpha/include/asm/Kbuild | 1 - arch/arc/include/asm/Kbuild | 1 - arch/arm/include/asm/Kbuild | 1 - arch/arm64/include/asm/Kbuild | 1 - arch/blackfin/include/asm/Kbuild | 1 - arch/c6x/include/asm/Kbuild | 1 - arch/cris/include/asm/Kbuild | 1 - arch/frv/include/asm/Kbuild | 1 - arch/h8300/include/asm/Kbuild | 1 - arch/hexagon/include/asm/Kbuild | 1 - arch/ia64/include/asm/Kbuild | 1 - arch/m32r/include/asm/Kbuild | 1 - arch/m68k/include/asm/Kbuild | 1 - arch/metag/include/asm/Kbuild | 1 - arch/microblaze/include/asm/Kbuild | 1 - arch/mips/include/asm/Kbuild | 1 - arch/mn10300/include/asm/Kbuild | 1 - arch/nios2/include/asm/Kbuild | 1 - arch/openrisc/include/asm/Kbuild | 1 - arch/parisc/include/asm/Kbuild | 1 - arch/powerpc/include/asm/Kbuild | 1 - arch/riscv/include/asm/Kbuild | 1 - arch/s390/include/asm/Kbuild | 1 - arch/score/include/asm/Kbuild | 1 - arch/sh/include/asm/Kbuild | 1 - arch/sparc/include/asm/Kbuild | 1 - arch/tile/include/asm/Kbuild | 1 - arch/um/include/asm/Kbuild | 1 - arch/unicore32/include/asm/Kbuild | 1 - arch/x86/include/asm/Kbuild | 1 - arch/xtensa/include/asm/Kbuild | 1 - include/asm-generic/clkdev.h | 30 ------------------------------ 32 files changed, 61 deletions(-) delete mode 100644 include/asm-generic/clkdev.h
arch/alpha/include/asm/Kbuild +0 -1
@@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -generic-y += clkdev.h generic-y += exec.h generic-y += export.h generic-y += fb.h
arch/arc/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 generic-y += bugs.h -generic-y += clkdev.h generic-y += device.h generic-y += div64.h generic-y += emergency-restart.h
arch/arm/include/asm/Kbuild +0 -1
@@ -1,4 +1,3 @@ -generic-y += clkdev.h generic-y += current.h generic-y += early_ioremap.h generic-y += emergency-restart.h
arch/arm64/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ generic-y += bugs.h -generic-y += clkdev.h generic-y += delay.h generic-y += div64.h generic-y += dma.h
arch/blackfin/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ generic-y += bugs.h -generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += div64.h
arch/c6x/include/asm/Kbuild +0 -1
@@ -1,7 +1,6 @@ generic-y += atomic.h generic-y += barrier.h generic-y += bugs.h -generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += div64.h
arch/cris/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ generic-y += atomic.h generic-y += barrier.h -generic-y += clkdev.h generic-y += cmpxchg.h generic-y += current.h generic-y += device.h
arch/frv/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ -generic-y += clkdev.h generic-y += device.h generic-y += exec.h generic-y += extable.h
arch/h8300/include/asm/Kbuild +0 -1
@@ -3,7 +3,6 @@ generic-y += barrier.h generic-y += bugs.h generic-y += cacheflush.h generic-y += checksum.h -generic-y += clkdev.h generic-y += current.h generic-y += delay.h generic-y += device.h
arch/hexagon/include/asm/Kbuild +0 -1
@@ -2,7 +2,6 @@ generic-y += barrier.h generic-y += bug.h generic-y += bugs.h -generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += div64.h
arch/ia64/include/asm/Kbuild +0 -1
@@ -1,4 +1,3 @@ -generic-y += clkdev.h generic-y += exec.h generic-y += irq_work.h generic-y += mcs_spinlock.h
arch/m32r/include/asm/Kbuild +0 -1
@@ -1,4 +1,3 @@ -generic-y += clkdev.h generic-y += current.h generic-y += exec.h generic-y += extable.h
arch/m68k/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ generic-y += barrier.h -generic-y += clkdev.h generic-y += device.h generic-y += emergency-restart.h generic-y += exec.h
arch/metag/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ generic-y += bugs.h -generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += dma.h
arch/microblaze/include/asm/Kbuild +0 -1
@@ -2,7 +2,6 @@ generic-y += barrier.h generic-y += bitops.h generic-y += bug.h generic-y += bugs.h -generic-y += clkdev.h generic-y += device.h generic-y += div64.h generic-y += emergency-restart.h
arch/mips/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ # MIPS headers generic-(CONFIG_GENERIC_CSUM) += checksum.h -generic-y += clkdev.h generic-y += current.h generic-y += dma-contiguous.h generic-y += emergency-restart.h
arch/mn10300/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ generic-y += barrier.h -generic-y += clkdev.h generic-y += device.h generic-y += exec.h generic-y += extable.h
arch/nios2/include/asm/Kbuild +0 -1
@@ -3,7 +3,6 @@ generic-y += barrier.h generic-y += bitops.h generic-y += bug.h generic-y += bugs.h -generic-y += clkdev.h generic-y += cmpxchg.h generic-y += current.h generic-y += device.h
arch/openrisc/include/asm/Kbuild +0 -1
@@ -2,7 +2,6 @@ generic-y += barrier.h generic-y += bug.h generic-y += bugs.h generic-y += checksum.h -generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += div64.h
arch/parisc/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ generic-y += barrier.h -generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += div64.h
arch/powerpc/include/asm/Kbuild +0 -1
@@ -1,4 +1,3 @@ -generic-y += clkdev.h generic-y += div64.h generic-y += export.h generic-y += irq_regs.h
arch/riscv/include/asm/Kbuild +0 -1
@@ -1,7 +1,6 @@ generic-y += bugs.h generic-y += cacheflush.h generic-y += checksum.h -generic-y += clkdev.h generic-y += cputime.h generic-y += device.h generic-y += div64.h
arch/s390/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ generic-y += asm-offsets.h generic-y += cacheflush.h -generic-y += clkdev.h generic-y += device.h generic-y += dma-contiguous.h generic-y += div64.h
arch/score/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ generic-y += barrier.h -generic-y += clkdev.h generic-y += current.h generic-y += extable.h generic-y += irq_work.h
arch/sh/include/asm/Kbuild +0 -1
@@ -1,4 +1,3 @@ -generic-y += clkdev.h generic-y += current.h generic-y += delay.h generic-y += div64.h
arch/sparc/include/asm/Kbuild +0 -1
@@ -1,7 +1,6 @@ # User exported sparc header files -generic-y += clkdev.h generic-y += div64.h generic-y += emergency-restart.h generic-y += exec.h
arch/tile/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ generic-y += bug.h generic-y += bugs.h -generic-y += clkdev.h generic-y += emergency-restart.h generic-y += exec.h generic-y += extable.h
arch/um/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ generic-y += barrier.h generic-y += bug.h -generic-y += clkdev.h generic-y += current.h generic-y += delay.h generic-y += device.h
arch/unicore32/include/asm/Kbuild +0 -1
@@ -1,6 +1,5 @@ generic-y += atomic.h generic-y += bugs.h -generic-y += clkdev.h generic-y += current.h generic-y += device.h generic-y += div64.h
arch/x86/include/asm/Kbuild +0 -1
@@ -6,7 +6,6 @@ generated-y += unistd_32_ia32.h generated-y += unistd_64_x32.h generated-y += xen-hypercalls.h -generic-y += clkdev.h generic-y += dma-contiguous.h generic-y += early_ioremap.h generic-y += mcs_spinlock.h
arch/xtensa/include/asm/Kbuild +0 -1
@@ -1,5 +1,4 @@ generic-y += bug.h -generic-y += clkdev.h generic-y += device.h generic-y += div64.h generic-y += dma-contiguous.h
include/asm-generic/clkdev.h deleted +0 -30
@@ -1,30 +0,0 @@ -/* -* include/asm-generic/clkdev.h -* -* Based on the ARM clkdev.h: -* Copyright (C) 2008 Russell King. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* Helper for the clk API to assist looking up a struct clk. -*/ -#ifndef __ASM_CLKDEV_H -#define __ASM_CLKDEV_H - -#include <linux/slab.h> - -#ifndef CONFIG_COMMON_CLK -struct clk ; - -static inline int __clk_get (struct clk *clk) {return 1 ; } -static inline void __clk_put (struct clk *clk) { } -#endif - -static inline struct clk_lookup_alloc *__clkdev_alloc (size_t size) -{ -return kzalloc (size,GFP_KERNEL ); -} - -#endif
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 3/5] arch: Remove clkdev.h asm-generic from Kbuild
Quoted 8 lines · Stephen Boyd
Now that every architecture is using the generic
clkdev.hfile and we no longer includeasm/clkdev.hanywhere in the tree, we can remove it.Cc Russell King <[email protected]>Cc Arnd Bergmann <[email protected]>Cc <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
For m68k part:
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 3/5] arch: Remove clkdev.h asm-generic from Kbuild
In reply to Stephen BoydQuoted 8 lines · Stephen Boyd
Now that every architecture is using the generic
clkdev.hfile and we no longer includeasm/clkdev.hanywhere in the tree, we can remove it.Cc Russell King <[email protected]>Cc Arnd Bergmann <[email protected]>Cc <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Stephen Boyd
AppliedRe: [PATCH 3/5] arch: Remove clkdev.h asm-generic from Kbuild
In reply to Stephen BoydQuoted 9 lines · Stephen Boyd
Now that every architecture is using the generic
clkdev.hfile and we no longer includeasm/clkdev.hanywhere in the tree, we can remove it.Cc Russell King <[email protected]>Cc Arnd Bergmann <[email protected]>Cc <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 4/5 clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks
In reply to Stephen BoydWe'd like to privatize __clk_get(), but the sunxi clk driver is calling this function to keep a reference held on the clk and call clk_prepare_enable() on it. We support this design in the clk core now with the CLK_IS_CRITICAL flag, so let's just use that instead.
--- drivers/clk/sunxi/clk-factors.c | 26 +++++++++++++++++++++----- drivers/clk/sunxi/clk-factors.h | 4 ++++ drivers/clk/sunxi/clk-mod0.c | 9 ++------- drivers/clk/sunxi/clk-sun8i-mbus.c | 7 ++----- drivers/clk/sunxi/clk-sun9i-core.c | 9 ++------- drivers/clk/sunxi/clk-sunxi.c | 36 +++++++++++++----------------------- 6 files changed, 44 insertions(+), 47 deletions(-)
drivers/clk/sunxi/clk-factors.c +21 -5
@@ -176,10 +176,10 @@ static const struct clk_ops clk_factors_ops = { .set_rate = clk_factors_set_rate, }; -struct clk *sunxi_factors_register (struct device_node *node, -const struct factors_data *data, -spinlock_t *lock, -void __iomem *reg) +struct clk *__sunxi_factors_register (struct device_node *node, +const struct factors_data *data, +spinlock_t *lock,void __iomem *reg, +unsigned long flags) {struct clk *clk;struct clk_factors *factors;
@@ -249,7 +249,7 @@ struct clk *sunxi_factors_register(struct device_node *node, parents, i, mux_hw, &clk_mux_ops, &factors->hw, &clk_factors_ops, - gate_hw, &clk_gate_ops, 0); + gate_hw, &clk_gate_ops, CLK_IS_CRITICAL);if (IS_ERR (clk)) goto err_register;
@@ -272,6 +272,22 @@ struct clk *sunxi_factors_register(struct device_node *node,return NULL ; } +struct clk *sunxi_factors_register (struct device_node *node, +const struct factors_data *data, +spinlock_t *lock, +void __iomem *reg) +{ +return __sunxi_factors_register (node, data, lock, reg,0 ); +} + +struct clk *sunxi_factors_register_critical (struct device_node *node, +const struct factors_data *data, +spinlock_t *lock, +void __iomem *reg) +{ +return __sunxi_factors_register (node, data, lock, reg,CLK_IS_CRITICAL ); +} +void sunxi_factors_unregister (struct device_node *node,struct clk *clk) {struct clk_hw *hw =__clk_get_hw (clk);
drivers/clk/sunxi/clk-factors.h +4 -0
@@ -55,6 +55,10 @@ struct clk *sunxi_factors_register(struct device_node *node,const struct factors_data *data, spinlock_t *lock, void __iomem *reg); +struct clk *sunxi_factors_register_critical (struct device_node *node, +const struct factors_data *data, +spinlock_t *lock, +void __iomem *reg);void sunxi_factors_unregister (struct device_node *node,struct clk *clk);
drivers/clk/sunxi/clk-mod0.c +2 -7
@@ -15,7 +15,6 @@*/ #include <linux/clk.h> -#include <linux/clkdev.h> #include <linux/clk-provider.h> #include <linux/of_address.h> #include <linux/platform_device.h>
@@ -155,7 +154,6 @@ static DEFINE_SPINLOCK(sun5i_a13_mbus_lock);static void __init sun5i_a13_mbus_setup (struct device_node *node) { -struct clk *mbus;void __iomem *reg; reg =of_iomap (node,0 );
@@ -164,12 +162,9 @@ static void __init sun5i_a13_mbus_setup(struct device_node *node)return ; } - mbus =sunxi_factors_register (node, &sun4i_a10_mod0_data, - &sun5i_a13_mbus_lock, reg); -/* The MBUS clocks needs to be always enabled */ -__clk_get (mbus); -clk_prepare_enable (mbus); +sunxi_factors_register_critical (node, &sun4i_a10_mod0_data, + &sun5i_a13_mbus_lock, reg); }CLK_OF_DECLARE (sun5i_a13_mbus,"allwinner,sun5i-a13-mbus-clk" , sun5i_a13_mbus_setup);
drivers/clk/sunxi/clk-sun8i-mbus.c +2 -5
@@ -15,7 +15,6 @@*/ #include <linux/clk.h> -#include <linux/clkdev.h> #include <linux/clk-provider.h> #include <linux/slab.h> #include <linux/spinlock.h>
@@ -82,11 +81,12 @@ static void __init sun8i_a23_mbus_setup(struct device_node *node) mux->mask =SUN8I_MBUS_MUX_MASK ; mux->lock = &sun8i_a23_mbus_lock; +/* The MBUS clocks needs to be always enabled */ clk =clk_register_composite (NULL , clk_name, parents, num_parents, &mux->hw, &clk_mux_ops, &div->hw, &clk_divider_ops, &gate->hw, &clk_gate_ops, -0 ); +CLK_IS_CRITICAL );if (IS_ERR (clk)) goto err_free_gate;
@@ -95,9 +95,6 @@ static void __init sun8i_a23_mbus_setup(struct device_node *node) goto err_unregister_clk;kfree (parents);/* parents is deep copied */ -/* The MBUS clocks needs to be always enabled */ -__clk_get (clk); -clk_prepare_enable (clk);return ;
drivers/clk/sunxi/clk-sun9i-core.c +2 -7
@@ -15,7 +15,6 @@*/ #include <linux/clk.h> -#include <linux/clkdev.h> #include <linux/clk-provider.h> #include <linux/of.h> #include <linux/of_address.h>
@@ -140,7 +139,6 @@ static DEFINE_SPINLOCK(sun9i_a80_gt_lock);static void __init sun9i_a80_gt_setup (struct device_node *node) {void __iomem *reg; -struct clk *gt; reg =of_io_request_and_map (node,0 ,of_node_full_name (node));if (IS_ERR (reg)) {
@@ -149,12 +147,9 @@ static void __init sun9i_a80_gt_setup(struct device_node *node)return ; } - gt =sunxi_factors_register (node, &sun9i_a80_gt_data, - &sun9i_a80_gt_lock, reg); -/* The GT bus clock needs to be always enabled */ -__clk_get (gt); -clk_prepare_enable (gt); +sunxi_factors_register_critical (node, &sun9i_a80_gt_data, + &sun9i_a80_gt_lock, reg); }CLK_OF_DECLARE (sun9i_a80_gt,"allwinner,sun9i-a80-gt-clk" , sun9i_a80_gt_setup);
drivers/clk/sunxi/clk-sunxi.c +13 -23
@@ -656,7 +656,8 @@ static const struct mux_data sun8i_h3_ahb2_mux_data __initconst = { };static struct clk *__init sunxi_mux_clk_setup (struct device_node *node, -const struct mux_data *data) +const struct mux_data *data, +unsigned long flags) {struct clk *clk;const char *clk_name = node->name;
@@ -678,7 +679,7 @@ static struct clk * __init sunxi_mux_clk_setup(struct device_node *node, } clk =clk_register_mux (NULL , clk_name, parents, i, -CLK_SET_RATE_PARENT , reg, +CLK_SET_RATE_PARENT | flags, reg, data->shift,SUNXI_MUX_GATE_WIDTH ,0 , &clk_lock);
@@ -703,29 +704,22 @@ static struct clk * __init sunxi_mux_clk_setup(struct device_node *node,static void __init sun4i_cpu_clk_setup (struct device_node *node) { -struct clk *clk; - - clk =sunxi_mux_clk_setup (node, &sun4i_cpu_mux_data); -if (!clk) -return ; -/* Protect CPU clock */ -__clk_get (clk); -clk_prepare_enable (clk); +sunxi_mux_clk_setup (node, &sun4i_cpu_mux_data,CLK_IS_CRITICAL ); }CLK_OF_DECLARE (sun4i_cpu,"allwinner,sun4i-a10-cpu-clk" , sun4i_cpu_clk_setup);static void __init sun6i_ahb1_mux_clk_setup (struct device_node *node) { -sunxi_mux_clk_setup (node, &sun6i_a31_ahb1_mux_data); +sunxi_mux_clk_setup (node, &sun6i_a31_ahb1_mux_data,0 ); }CLK_OF_DECLARE (sun6i_ahb1_mux,"allwinner,sun6i-a31-ahb1-mux-clk" , sun6i_ahb1_mux_clk_setup);static void __init sun8i_ahb2_clk_setup (struct device_node *node) { -sunxi_mux_clk_setup (node, &sun8i_h3_ahb2_mux_data); +sunxi_mux_clk_setup (node, &sun8i_h3_ahb2_mux_data,0 ); }CLK_OF_DECLARE (sun8i_ahb2,"allwinner,sun8i-h3-ahb2-clk" , sun8i_ahb2_clk_setup);
@@ -900,6 +894,7 @@ struct divs_data {u8 shift;/* otherwise it's a normal divisor with this shift */ u8 pow;/* is it power-of-two based? */ u8 gate;/* is it independently gateable? */ +bool critical; } div[SUNXI_DIVS_MAX_QTY ]; };
@@ -915,7 +910,8 @@ static const struct divs_data pll5_divs_data __initconst = { .factors = &sun4i_pll5_data, .ndivs = 2, .div = { - { .shift = 0, .pow = 0, }, /* M, DDR */ +/* Protect PLL5_DDR */ + { .shift = 0, .pow = 0, .critical = true }, /* M, DDR */ { .shift = 16, .pow = 1, }, /* P, other *//* No output for the base factor clock */ }
@@ -1089,7 +1085,9 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node,NULL ,NULL , rate_hw, rate_ops, gate_hw, &clk_gate_ops, - clkflags); + clkflags | + data->div[i].critical ? + CLK_IS_CRITICAL : 0);WARN_ON (IS_ERR (clk_data->clks[i])); }
@@ -1117,15 +1115,7 @@ static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node,static void __init sun4i_pll5_clk_setup (struct device_node *node) { -struct clk **clks; - - clks =sunxi_divs_clk_setup (node, &pll5_divs_data); -if (!clks) -return ; - -/* Protect PLL5_DDR */ -__clk_get (clks[0 ]); -clk_prepare_enable (clks[0 ]); +sunxi_divs_clk_setup (node, &pll5_divs_data); }CLK_OF_DECLARE (sun4i_pll5,"allwinner,sun4i-a10-pll5-clk" , sun4i_pll5_clk_setup);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 4/5] clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks
Quoted 23 lines · Stephen Boyd
We'd like to privatize
__clk_get(), but the sunxi clk driver is calling this function to keep a reference held on the clk and callclk_prepare_enable()on it. We support this design in the clk core now with theCLK_IS_CRITICALflag, so let's just use that instead.Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/clk/sunxi/clk-factors.c | 26 +++++++++++++++++++++----- drivers/clk/sunxi/clk-factors.h | 4 ++++ drivers/clk/sunxi/clk-mod0.c | 9 ++------- drivers/clk/sunxi/clk-sun8i-mbus.c | 7 ++----- drivers/clk/sunxi/clk-sun9i-core.c | 9 ++------- drivers/clk/sunxi/clk-sunxi.c | 36 +++++++++++++----------------------- 6 files changed, 44 insertions(+), 47 deletions(-)drivers/clk/sunxi/clk-factors.c +0
-0
drivers/clk/sunxi/clk-factors.c static const struct clk_ops clk_factors_ops = { · line 179
Quoted 8 lines
drivers/clk/sunxi/clk-factors.c +1
-4@@ -176,10 +176,10 @@ static const struct clk_ops clk_factors_ops = { .set_rate = clk_factors_set_rate, }; -struct clk *sunxi_factors_register (struct device_node *node, -const struct factors_data *data, -spinlock_t *lock, -void __iomem *reg) +struct clk *__sunxi_factors_register(struct device_node *node,
This looks like it's only used within the file by the two wrapper functions. Mark it static?
Otherwise
Looks like you picked the easiest (least code changes) for each type of clock?
Re: [PATCH 4/5] clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks
Quoted 27 lines · Chen-Yu Tsai
Quoted 26 lines · Stephen Boyd
We'd like to privatize
__clk_get(), but the sunxi clk driver is calling this function to keep a reference held on the clk and callclk_prepare_enable()on it. We support this design in the clk core now with theCLK_IS_CRITICALflag, so let's just use that instead.Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/clk/sunxi/clk-factors.c | 26 +++++++++++++++++++++----- drivers/clk/sunxi/clk-factors.h | 4 ++++ drivers/clk/sunxi/clk-mod0.c | 9 ++------- drivers/clk/sunxi/clk-sun8i-mbus.c | 7 ++----- drivers/clk/sunxi/clk-sun9i-core.c | 9 ++------- drivers/clk/sunxi/clk-sunxi.c | 36 +++++++++++++----------------------- 6 files changed, 44 insertions(+), 47 deletions(-)drivers/clk/sunxi/clk-factors.c +0
-0@@ -176,10 +176,10 @@ static const struct clk_ops clk_factors_ops = { .set_rate = clk_factors_set_rate, };
Quoted 8 lines
drivers/clk/sunxi/clk-factors.c static const struct clk_ops clk_factors_ops = { · line 179
Quoted 5 lines
drivers/clk/sunxi/clk-factors.c +1
-4-struct clk *sunxi_factors_register (struct device_node *node, -const struct factors_data *data, -spinlock_t *lock, -void __iomem *reg) +struct clk *__sunxi_factors_register(struct device_node *node,This looks like it's only used within the file by the two wrapper functions. Mark it static?
Ah thanks. I hadn't run sparse yet.
Quoted 7 lines
Otherwise
Reviewed-by Chen-Yu Tsai <[email protected]>Looks like you picked the easiest (least code changes) for each type of clock?
Yep.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH 4/5] clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks
In reply to Stephen BoydQuoted 9 lines · Stephen Boyd
We'd like to privatize
__clk_get(), but the sunxi clk driver is calling this function to keep a reference held on the clk and callclk_prepare_enable()on it. We support this design in the clk core now with theCLK_IS_CRITICALflag, so let's just use that instead.Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Stephen Boyd
AppliedRe: [PATCH 4/5] clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks
In reply to Stephen BoydQuoted 10 lines · Stephen Boyd
We'd like to privatize
__clk_get(), but the sunxi clk driver is calling this function to keep a reference held on the clk and callclk_prepare_enable()on it. We support this design in the clk core now with theCLK_IS_CRITICALflag, so let's just use that instead.Cc Maxime Ripard <[email protected]>Cc Chen-Yu Tsai <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH 5/5 clk: Move __clk_{get,put}() into private clk.h API
In reply to Stephen BoydWe can move these APIs into the private header file now that we don't have any users of the __clk_get() and __clk_put() APIs outside of clkdev.c and clk.c.
--- drivers/clk/clk.h | 4 ++++ include/linux/clkdev.h | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/clk/clk.h +4 -0
@@ -20,6 +20,8 @@ struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec,struct clk *__clk_create_clk (struct clk_hw *hw,const char *dev_id,const char *con_id);void __clk_free_clk (struct clk *clk); +int __clk_get (struct clk *clk); +void __clk_put (struct clk *clk);#else /* All these casts to avoid ifdefs in clkdev... */ static inline struct clk *
@@ -32,5 +34,7 @@ static struct clk_hw *__clk_get_hw(struct clk *clk) {return (struct clk_hw *)clk; } +static inline int __clk_get (struct clk *clk) {return 1 ; } +static inline void __clk_put (struct clk *clk) { }#endif
include/linux/clkdev.h +0 -8
@@ -52,12 +52,4 @@ int clk_add_alias(const char *, const char *, const char *, struct device *);int clk_register_clkdev (struct clk *,const char *,const char *);int clk_hw_register_clkdev (struct clk_hw *,const char *,const char *); -#ifdef CONFIG_COMMON_CLK -int __clk_get (struct clk *clk); -void __clk_put (struct clk *clk); -#else -static inline int __clk_get (struct clk *clk) {return 1 ; } -static inline void __clk_put (struct clk *clk) { } -#endif -#endif
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Stephen Boyd
AppliedRe: [PATCH 5/5] clk: Move __clk_{get,put}() into private clk.h API
Quoted 7 lines · Stephen Boyd
We can move these APIs into the private header file now that we don't have any users of the
__clk_get()and__clk_put()APIs outside ofclkdev.candclk.c.Cc Russell King <[email protected]>Signed-off-by Stephen Boyd <[email protected]>---
Applied to clk-next
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project