[PATCH 30/33] video: stm32_dsi: migrate trace to dev and log macro

Philippe CORNU philippe.cornu at st.com
Thu Oct 15 10:50:05 CEST 2020



On 10/14/20 11:16 AM, Patrick Delaunay wrote:
> Change pr_* to dev_ or log_ macro and define LOG_CATEGORY.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> ---
> 
>   drivers/video/stm32/stm32_dsi.c | 18 ++++++++++--------
>   1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/video/stm32/stm32_dsi.c b/drivers/video/stm32/stm32_dsi.c
> index 9d5abacc2b..dcec0edafc 100644
> --- a/drivers/video/stm32/stm32_dsi.c
> +++ b/drivers/video/stm32/stm32_dsi.c
> @@ -8,6 +8,8 @@
>    * drivers/gpu/drm/stm/dw_mipi_dsi-stm.c.
>    */
>   
> +#define LOG_CATEGORY UCLASS_VIDEO_BRIDGE
> +
>   #include <common.h>
>   #include <clk.h>
>   #include <dm.h>
> @@ -133,7 +135,7 @@ static enum dsi_color dsi_color_from_mipi(u32 fmt)
>   	case MIPI_DSI_FMT_RGB565:
>   		return DSI_RGB565_CONF1;
>   	default:
> -		pr_err("MIPI color invalid, so we use rgb888\n");
> +		log_err("MIPI color invalid, so we use rgb888\n");
>   	}
>   	return DSI_RGB888;
>   }
> @@ -213,14 +215,14 @@ static int dsi_phy_init(void *priv_data)
>   	u32 val;
>   	int ret;
>   
> -	debug("Initialize DSI physical layer\n");
> +	dev_dbg(dev, "Initialize DSI physical layer\n");
>   
>   	/* Enable the regulator */
>   	dsi_set(dsi, DSI_WRPCR, WRPCR_REGEN | WRPCR_BGREN);
>   	ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_RRS,
>   				 TIMEOUT_US);
>   	if (ret) {
> -		debug("!TIMEOUT! waiting REGU\n");
> +		dev_dbg(dev, "!TIMEOUT! waiting REGU\n");
>   		return ret;
>   	}
>   
> @@ -229,7 +231,7 @@ static int dsi_phy_init(void *priv_data)
>   	ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_PLLLS,
>   				 TIMEOUT_US);
>   	if (ret) {
> -		debug("!TIMEOUT! waiting PLL\n");
> +		dev_dbg(dev, "!TIMEOUT! waiting PLL\n");
>   		return ret;
>   	}
>   
> @@ -242,8 +244,8 @@ static void dsi_phy_post_set_mode(void *priv_data, unsigned long mode_flags)
>   	struct udevice *dev = device->dev;
>   	struct stm32_dsi_priv *dsi = dev_get_priv(dev);
>   
> -	debug("Set mode %p enable %ld\n", dsi,
> -	      mode_flags & MIPI_DSI_MODE_VIDEO);
> +	dev_dbg(dev, "Set mode %p enable %ld\n", dsi,
> +		mode_flags & MIPI_DSI_MODE_VIDEO);
>   
>   	if (!dsi)
>   		return;
> @@ -325,8 +327,8 @@ static int dsi_get_lane_mbps(void *priv_data, struct display_timing *timings,
>   
>   	*lane_mbps = pll_out_khz / 1000;
>   
> -	debug("pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n",
> -	      pll_in_khz, pll_out_khz, *lane_mbps);
> +	dev_dbg(dev, "pll_in %ukHz pll_out %ukHz lane_mbps %uMHz\n",
> +		pll_in_khz, pll_out_khz, *lane_mbps);
>   
>   	return 0;
>   }
> 

Hi Patrick,

and many thanks for your patch.
Reviewed-by: Philippe Cornu <philippe.cornu at st.com>

Philippe :-)


More information about the U-Boot mailing list