public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 26/31] clk: Drop dm.h header file in clk-provider.h
Date: Sun, 19 Jul 2020 12:54:13 -0400	[thread overview]
Message-ID: <e38a7c9d-1aa8-e02a-1f21-3ce8e098a396@gmail.com> (raw)
In-Reply-To: <20200719161601.495421-27-sjg@chromium.org>

On 7/19/20 12:15 PM, Simon Glass wrote:
> This header file should not be included in other header files. Remove it
> and use a forward declaration and un-inlining of dev_get_clk_ptr()
> instead.
> 
> Fix up the kendryte header files to avoid build errors.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  drivers/clk/clk-uclass.c      |  5 +++++
>  drivers/clk/kendryte/bypass.c |  7 +++++--
>  drivers/clk/kendryte/pll.c    | 10 ++++++----
>  include/kendryte/bypass.h     |  2 +-
>  include/linux/clk-provider.h  |  8 +++-----
>  5 files changed, 20 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
> index 15656f5973..934cd5787a 100644
> --- a/drivers/clk/clk-uclass.c
> +++ b/drivers/clk/clk-uclass.c
> @@ -25,6 +25,11 @@ static inline const struct clk_ops *clk_dev_ops(struct udevice *dev)
>  	return (const struct clk_ops *)dev->driver->ops;
>  }
>  
> +struct clk *dev_get_clk_ptr(struct udevice *dev)
> +{
> +	return (struct clk *)dev_get_uclass_priv(dev);
> +}
> +
>  #if CONFIG_IS_ENABLED(OF_CONTROL)
>  # if CONFIG_IS_ENABLED(OF_PLATDATA)
>  int clk_get_by_driver_info(struct udevice *dev, struct phandle_1_arg *cells,
> diff --git a/drivers/clk/kendryte/bypass.c b/drivers/clk/kendryte/bypass.c
> index d1fd28175b..5f1986f2cb 100644
> --- a/drivers/clk/kendryte/bypass.c
> +++ b/drivers/clk/kendryte/bypass.c
> @@ -4,12 +4,15 @@
>   */
>  
>  #define LOG_CATEGORY UCLASS_CLK
> -#include <kendryte/bypass.h>
>  
> +#include <common.h>
> +#include <clk.h>
>  #include <clk-uclass.h>
> +#include <dm.h>
> +#include <log.h>
> +#include <kendryte/bypass.h>
>  #include <linux/clk-provider.h>
>  #include <linux/err.h>
> -#include <log.h>
>  
>  #define CLK_K210_BYPASS "k210_clk_bypass"
>  
> diff --git a/drivers/clk/kendryte/pll.c b/drivers/clk/kendryte/pll.c
> index 19e358856a..ab6d75d585 100644
> --- a/drivers/clk/kendryte/pll.c
> +++ b/drivers/clk/kendryte/pll.c
> @@ -3,18 +3,20 @@
>   * Copyright (C) 2019-20 Sean Anderson <seanga2@gmail.com>
>   */
>  #define LOG_CATEGORY UCLASS_CLK
> -#include <kendryte/pll.h>
>  
> -#include <asm/io.h>
> +#include <common.h>
> +#include <dm.h>
>  /* For DIV_ROUND_DOWN_ULL, defined in linux/kernel.h */
>  #include <div64.h>
> +#include <log.h>
> +#include <serial.h>
> +#include <asm/io.h>
>  #include <dt-bindings/clock/k210-sysctl.h>
> +#include <kendryte/pll.h>
>  #include <linux/bitfield.h>
>  #include <linux/clk-provider.h>
>  #include <linux/delay.h>
>  #include <linux/err.h>
> -#include <log.h>
> -#include <serial.h>
>  
>  #define CLK_K210_PLL "k210_clk_pll"
>  
> diff --git a/include/kendryte/bypass.h b/include/kendryte/bypass.h
> index a081cbd12f..ab85bbcbfc 100644
> --- a/include/kendryte/bypass.h
> +++ b/include/kendryte/bypass.h
> @@ -5,7 +5,7 @@
>  #ifndef K210_BYPASS_H
>  #define K210_BYPASS_H
>  
> -#include <clk.h>
> +struct clk;
>  
>  struct k210_bypass {
>  	struct clk clk;
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 8a20743ad8..79dce8f0ad 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -9,12 +9,13 @@
>  #ifndef __LINUX_CLK_PROVIDER_H
>  #define __LINUX_CLK_PROVIDER_H
>  
> -#include <dm.h>
>  #include <linux/bitops.h>
>  #include <linux/err.h>
>  #include <clk-uclass.h>
>  #include <linux/err.h>
>  
> +struct udevice;
> +
>  static inline void clk_dm(ulong id, struct clk *clk)
>  {
>  	if (!IS_ERR(clk))
> @@ -188,8 +189,5 @@ struct clk *clk_register_mux(struct device *dev, const char *name,
>  const char *clk_hw_get_name(const struct clk *hw);
>  ulong clk_generic_get_rate(struct clk *clk);
>  
> -static inline struct clk *dev_get_clk_ptr(struct udevice *dev)
> -{
> -	return (struct clk *)dev_get_uclass_priv(dev);
> -}
> +struct clk *dev_get_clk_ptr(struct udevice *dev);
>  #endif /* __LINUX_CLK_PROVIDER_H */
> 

Reviewed-by: Sean Anderson <seanga2@gmail.com>

  reply	other threads:[~2020-07-19 16:54 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 16:15 [PATCH 00/31] dm: Avoid including dm.h in header files Simon Glass
2020-07-19 16:15 ` [PATCH 01/31] spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL Simon Glass
2020-08-04 15:03   ` Tom Rini
2020-07-19 16:15 ` [PATCH 02/31] mtd: spi-nor: Tidy up error handling / debug code Simon Glass
2020-07-20  6:12   ` Vignesh Raghavendra
2020-07-26 14:54     ` Simon Glass
2020-07-30  9:19       ` Vignesh Raghavendra
2020-08-04 15:03   ` Tom Rini
2020-07-19 16:15 ` [PATCH 03/31] wdt: Drop dm.h header file Simon Glass
2020-08-04 15:03   ` Tom Rini
2020-07-19 16:15 ` [PATCH 04/31] mtd: spi-mem: " Simon Glass
2020-08-04 15:03   ` Tom Rini
2020-07-19 16:15 ` [PATCH 05/31] mtd: spi: Drop SPI_XFER_MMAP* Simon Glass
2020-08-04 15:03   ` Tom Rini
2020-07-19 16:15 ` [PATCH 06/31] dm: core: Drop dm.h header file from dm-demo.h Simon Glass
2020-08-04 15:03   ` Tom Rini
2020-07-19 16:15 ` [PATCH 07/31] dm: core: Drop header files from dm/test.h Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 08/31] fs: fs-loader: Drop dm.h header file Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 09/31] net: Drop dm.h header file from phy.h Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 10/31] sf: Drop dm.h header file from spi_flash.h Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 11/31] thermal: Drop dm.h header file Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 12/31] w1: " Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 13/31] efi: Tidy up header includes Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 14/31] power: Tidy up inclusion of regulator_common.h Simon Glass
2020-07-20 23:14   ` Jaehoon Chung
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 15/31] mmc: Drop duplicate dm.h inclusion Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 16/31] spi: " Simon Glass
2020-08-04 15:04   ` Tom Rini
2020-07-19 16:15 ` [PATCH 17/31] ti: am654: " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 18/31] liebherr: " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 19/31] pci: Drop dm.h inclusion from header file Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 20/31] mediatek: Drop dm.h " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 21/31] mscc: " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 22/31] adc: " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 23/31] nand: " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 24/31] ufs: " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 25/31] usb: " Simon Glass
2020-08-04 15:05   ` Tom Rini
2020-07-19 16:15 ` [PATCH 26/31] clk: Drop dm.h header file in clk-provider.h Simon Glass
2020-07-19 16:54   ` Sean Anderson [this message]
2020-08-04 15:06   ` Tom Rini
2020-07-19 16:15 ` [PATCH 27/31] net: Drop dm.h header file in eth_phy.h Simon Glass
2020-08-04 15:06   ` Tom Rini
2020-07-19 16:15 ` [PATCH 28/31] net: Drop duplicate include of dm.h in pcnet.c Simon Glass
2020-08-04 15:06   ` Tom Rini
2020-07-19 16:15 ` [PATCH 29/31] dm: core: Guard against including dm.h in header files Simon Glass
2020-08-04 15:06   ` Tom Rini
2020-07-19 16:16 ` [PATCH 30/31] patman: Fix up the test comments Simon Glass
2020-08-04 15:06   ` Tom Rini
2020-07-19 16:16 ` [PATCH 31/31] checkpatch: Don't allow common.h and dm.h in headers Simon Glass
2020-08-04 15:06   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e38a7c9d-1aa8-e02a-1f21-3ce8e098a396@gmail.com \
    --to=seanga2@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox