All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: u-boot@lists.denx.de
Subject: [PATCH 24/33] spi: stm32_spi: migrate trace to dev and log macro
Date: Wed, 21 Oct 2020 12:34:08 +0000	[thread overview]
Message-ID: <1f2ba42a-dff1-9319-8819-6294eaacba5b@st.com> (raw)
In-Reply-To: <20201014091646.4233-25-patrick.delaunay@st.com>

Hi Patrick

On 10/14/20 11:16 AM, Patrick Delaunay wrote:
> Change debug/pr_debug to log_debug or dev_dbg macro and
> define LOG_CATEGORY.
>
> Remove the "%s:" __func__  header as it is managed by dev macro
> (dev->name is displayed) or log macro (CONFIG_LOGF_FUNC).
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  drivers/spi/stm32_spi.c | 31 +++++++++++++++++--------------
>  1 file changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/spi/stm32_spi.c b/drivers/spi/stm32_spi.c
> index 4a0833b6fa..086a84572b 100644
> --- a/drivers/spi/stm32_spi.c
> +++ b/drivers/spi/stm32_spi.c
> @@ -4,6 +4,9 @@
>   *
>   * Driver for STMicroelectronics Serial peripheral interface (SPI)
>   */
> +
> +#define LOG_CATEGORY UCLASS_SPI
> +
>  #include <common.h>
>  #include <clk.h>
>  #include <dm.h>
> @@ -138,7 +141,7 @@ static void stm32_spi_write_txfifo(struct stm32_spi_priv *priv)
>  		}
>  	}
>  
> -	debug("%s: %d bytes left\n", __func__, priv->tx_len);
> +	log_debug("%d bytes left\n", priv->tx_len);
>  }
>  
>  static void stm32_spi_read_rxfifo(struct stm32_spi_priv *priv)
> @@ -176,12 +179,12 @@ static void stm32_spi_read_rxfifo(struct stm32_spi_priv *priv)
>  		rxplvl = (sr & SPI_SR_RXPLVL) >> SPI_SR_RXPLVL_SHIFT;
>  	}
>  
> -	debug("%s: %d bytes left\n", __func__, priv->rx_len);
> +	log_debug("%d bytes left\n", priv->rx_len);
>  }
>  
>  static int stm32_spi_enable(struct stm32_spi_priv *priv)
>  {
> -	debug("%s\n", __func__);
> +	log_debug("\n");
>  
>  	/* Enable the SPI hardware */
>  	setbits_le32(priv->base + STM32_SPI_CR1, SPI_CR1_SPE);
> @@ -191,7 +194,7 @@ static int stm32_spi_enable(struct stm32_spi_priv *priv)
>  
>  static int stm32_spi_disable(struct stm32_spi_priv *priv)
>  {
> -	debug("%s\n", __func__);
> +	log_debug("\n");
>  
>  	/* Disable the SPI hardware */
>  	clrbits_le32(priv->base + STM32_SPI_CR1, SPI_CR1_SPE);
> @@ -204,7 +207,7 @@ static int stm32_spi_claim_bus(struct udevice *slave)
>  	struct udevice *bus = dev_get_parent(slave);
>  	struct stm32_spi_priv *priv = dev_get_priv(bus);
>  
> -	debug("%s\n", __func__);
> +	dev_dbg(slave, "\n");
>  
>  	/* Enable the SPI hardware */
>  	return stm32_spi_enable(priv);
> @@ -215,7 +218,7 @@ static int stm32_spi_release_bus(struct udevice *slave)
>  	struct udevice *bus = dev_get_parent(slave);
>  	struct stm32_spi_priv *priv = dev_get_priv(bus);
>  
> -	debug("%s\n", __func__);
> +	dev_dbg(slave, "\n");
>  
>  	/* Disable the SPI hardware */
>  	return stm32_spi_disable(priv);
> @@ -227,7 +230,7 @@ static void stm32_spi_stopxfer(struct udevice *dev)
>  	u32 cr1, sr;
>  	int ret;
>  
> -	debug("%s\n", __func__);
> +	dev_dbg(dev, "\n");
>  
>  	cr1 = readl(priv->base + STM32_SPI_CR1);
>  
> @@ -255,7 +258,7 @@ static int stm32_spi_set_cs(struct udevice *dev, unsigned int cs, bool enable)
>  {
>  	struct stm32_spi_priv *priv = dev_get_priv(dev);
>  
> -	debug("%s: cs=%d enable=%d\n", __func__, cs, enable);
> +	dev_dbg(dev, "cs=%d enable=%d\n", cs, enable);
>  
>  	if (cs >= MAX_CS_COUNT)
>  		return -ENODEV;
> @@ -274,7 +277,7 @@ static int stm32_spi_set_mode(struct udevice *bus, uint mode)
>  	struct stm32_spi_priv *priv = dev_get_priv(bus);
>  	u32 cfg2_clrb = 0, cfg2_setb = 0;
>  
> -	debug("%s: mode=%d\n", __func__, mode);
> +	dev_dbg(bus, "mode=%d\n", mode);
>  
>  	if (mode & SPI_CPOL)
>  		cfg2_setb |= SPI_CFG2_CPOL;
> @@ -330,7 +333,7 @@ static int stm32_spi_set_speed(struct udevice *bus, uint hz)
>  	u32 mbrdiv;
>  	long div;
>  
> -	debug("%s: hz=%d\n", __func__, hz);
> +	dev_dbg(bus, "hz=%d\n", hz);
>  
>  	if (priv->cur_hz == hz)
>  		return 0;
> @@ -404,8 +407,8 @@ static int stm32_spi_xfer(struct udevice *slave, unsigned int bitlen,
>  		stm32_spi_enable(priv);
>  	}
>  
> -	debug("%s: priv->tx_len=%d priv->rx_len=%d\n", __func__,
> -	      priv->tx_len, priv->rx_len);
> +	dev_dbg(bus, "priv->tx_len=%d priv->rx_len=%d\n",
> +		priv->tx_len, priv->rx_len);
>  
>  	slave_plat = dev_get_parent_platdata(slave);
>  	if (flags & SPI_XFER_BEGIN)
> @@ -477,7 +480,7 @@ static int stm32_spi_get_fifo_size(struct udevice *dev)
>  
>  	stm32_spi_disable(priv);
>  
> -	debug("%s %d x 8-bit fifo size\n", __func__, count);
> +	dev_dbg(dev, "%d x 8-bit fifo size\n", count);
>  
>  	return count;
>  }
> @@ -522,7 +525,7 @@ static int stm32_spi_probe(struct udevice *dev)
>  	ret = gpio_request_list_by_name(dev, "cs-gpios", priv->cs_gpios,
>  					ARRAY_SIZE(priv->cs_gpios), 0);
>  	if (ret < 0) {
> -		pr_err("Can't get %s cs gpios: %d", dev->name, ret);
> +		dev_err(dev, "Can't get cs gpios: %d", ret);
>  		goto reset_err;
>  	}
>  

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

  reply	other threads:[~2020-10-21 12:34 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  9:16 [PATCH 00/33] stm32: enable logging features Patrick Delaunay
2020-10-14  9:16 ` [PATCH 01/33] arm: stm32mp: migrate trace to log macro Patrick Delaunay
2020-10-21 12:01   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 02/33] arm: stm32mp: migrate cmd_stm32prog " Patrick Delaunay
2020-10-21 12:01   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 03/33] arm: stm32mp: bsec: migrate trace " Patrick Delaunay
2020-10-21 12:01   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 04/33] pinctrl: stm32: " Patrick Delaunay
2020-10-21 12:38   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 05/33] gpio: stm32-gpio: migrate trace to dev and " Patrick Delaunay
2020-10-21 12:24   ` Patrice CHOTARD
2020-10-21 12:29   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 06/33] remoproc: stm32: migrate trace to " Patrick Delaunay
2020-10-21 12:25   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 07/33] ram: " Patrick Delaunay
2020-10-21 12:25   ` [Uboot-stm32] " Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 08/33] ram: stm32mp1: migrate trace to dev or " Patrick Delaunay
2020-10-21 12:25   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 09/33] mmc: stm32_sdmmc2: migrate trace to dev and " Patrick Delaunay
2020-10-15 10:25   ` Peng Fan
2020-10-21 12:26   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 10/33] timer: stm32: migrate trace to " Patrick Delaunay
2020-10-21 12:26   ` [Uboot-stm32] " Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 11/33] hwspinlock: " Patrick Delaunay
2020-10-21 12:26   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 12/33] rtc: " Patrick Delaunay
2020-10-21 12:26   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 13/33] watchdog: stm32mp: migrate trace to dev macro Patrick Delaunay
2020-10-21 12:27   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 14/33] power: regulator: stm32-verfbuf: define LOG_CATEGORY Patrick Delaunay
2020-10-21 12:27   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 15/33] misc: rcc: migrate trace to dev macro Patrick Delaunay
2020-10-21 12:27   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 16/33] misc: rcc: keep the rcc device name for subnode Patrick Delaunay
2020-10-21 12:28   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 17/33] clk: stm32mp1: migrate trace to dev and log macro Patrick Delaunay
2020-10-21 12:28   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 18/33] clk: clk_stm32f: " Patrick Delaunay
2020-10-21 12:32   ` [Uboot-stm32] " Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 19/33] clk: clk_stm32h7: " Patrick Delaunay
2020-10-21 12:32   ` [Uboot-stm32] " Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 20/33] reset: stm32-reset: " Patrick Delaunay
2020-10-21 12:32   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 21/33] mailbox: stm32-ipcc: " Patrick Delaunay
2020-10-21 12:33   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 22/33] i2c: stm32f7_i2c: " Patrick Delaunay
2020-10-21 12:33   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 23/33] phy: stm32-usbphyc: " Patrick Delaunay
2020-10-21 12:33   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 24/33] spi: stm32_spi: " Patrick Delaunay
2020-10-21 12:34   ` Patrice CHOTARD [this message]
2020-10-14  9:16 ` [PATCH 25/33] spi: stm32_qspi: " Patrick Delaunay
2020-10-21 12:34   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 26/33] mtd: stm32_fmc2: " Patrick Delaunay
2020-10-21 12:34   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 27/33] memory: stm32-fmc2: " Patrick Delaunay
2020-10-21 12:34   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 28/33] serial: stm32: define LOG_CATEGORY Patrick Delaunay
2020-10-21 12:34   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 29/33] video: stm32_ltdc: migrate trace to dev and log macro Patrick Delaunay
2020-10-21 12:35   ` Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 30/33] video: stm32_dsi: " Patrick Delaunay
2020-10-15  8:50   ` Philippe CORNU
2020-10-14  9:16 ` [PATCH 31/33] board: st: stm32mp1: " Patrick Delaunay
2020-10-21 12:35   ` [Uboot-stm32] " Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 32/33] board: st: common: " Patrick Delaunay
2020-10-21 12:36   ` [Uboot-stm32] " Patrice CHOTARD
2020-10-14  9:16 ` [PATCH 33/33] configs: stm32mp15: enable LOG features Patrick Delaunay
2020-10-21 12:37   ` [Uboot-stm32] " Patrice CHOTARD
2020-10-15 15:05 ` [PATCH 00/33] stm32: enable logging features Simon Glass
2020-10-15 15:59   ` Patrick DELAUNAY
2020-10-26 19:22     ` Simon Glass
2020-10-28 11:52       ` Patrick DELAUNAY
2020-10-30 18:15         ` Simon Glass
2020-11-06 17:45           ` Patrick DELAUNAY
2020-11-06 18:50             ` Simon Glass

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=1f2ba42a-dff1-9319-8819-6294eaacba5b@st.com \
    --to=patrice.chotard@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.