diff mbox series

[1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe

Message ID 20240528093922.194684-1-alexander.stein@ew.tq-group.com (mailing list archive)
State New, archived
Headers show
Series [1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe | expand

Commit Message

Alexander Stein May 28, 2024, 9:39 a.m. UTC
Although very unlike to occur (media_blk_ctrl needs 'syscon' compatible
removed), it lines up with the other error paths in probe function.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Ying Liu May 28, 2024, 10:02 a.m. UTC | #1
On 05/28/2024, Alexander Stein wrote:
> Although very unlike to occur (media_blk_ctrl needs 'syscon' compatible
> removed), it lines up with the other error paths in probe function.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>  drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> index 2347f8dd632f9..8331db3b4f054 100644
> --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> @@ -841,11 +841,9 @@ static int imx93_dsi_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
> -	if (IS_ERR(dsi->regmap)) {
> -		ret = PTR_ERR(dsi->regmap);
> -		dev_err(dev, "failed to get block ctrl regmap: %d\n", ret);
> -		return ret;
> -	}
> +	if (IS_ERR(dsi->regmap))
> +		return dev_err_probe(dev, PTR_ERR(dsi->regmap),
> +				     "failed to get block ctrl regmap");

Missing \n.

And, a build warning:
drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c: In function ‘imx93_dsi_probe’:
drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c:837:13: warning: unused variable ‘ret’ [-Wunused-variable]
  837 |         int ret;
      |             ^~~

Regards,
Liu Ying

>  
>  	dsi->clk_pixel = devm_clk_get(dev, "pix");
>  	if (IS_ERR(dsi->clk_pixel))
Alexander Stein May 28, 2024, 11:50 a.m. UTC | #2
Hi,

thanks for your feedback.

Am Dienstag, 28. Mai 2024, 12:02:29 CEST schrieb Liu Ying:
> On 05/28/2024, Alexander Stein wrote:
> > Although very unlike to occur (media_blk_ctrl needs 'syscon' compatible
> > removed), it lines up with the other error paths in probe function.
> > 
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> >  drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > index 2347f8dd632f9..8331db3b4f054 100644
> > --- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > +++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
> > @@ -841,11 +841,9 @@ static int imx93_dsi_probe(struct platform_device *pdev)
> >  		return -ENOMEM;
> >  
> >  	dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
> > -	if (IS_ERR(dsi->regmap)) {
> > -		ret = PTR_ERR(dsi->regmap);
> > -		dev_err(dev, "failed to get block ctrl regmap: %d\n", ret);
> > -		return ret;
> > -	}
> > +	if (IS_ERR(dsi->regmap))
> > +		return dev_err_probe(dev, PTR_ERR(dsi->regmap),
> > +				     "failed to get block ctrl regmap");
> 
> Missing \n.
> 
> And, a build warning:
> drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c: In function ‘imx93_dsi_probe’:
> drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c:837:13: warning: unused variable ‘ret’ [-Wunused-variable]
>   837 |         int ret;
>       |             ^~~
> 

Nice catch. Thanks. I'll send v2 tomorrow.

Best regards,
Alexander
kernel test robot May 28, 2024, 3:51 p.m. UTC | #3
Hi Alexander,

kernel test robot noticed the following build warnings:

[auto build test WARNING on shawnguo/for-next]
[also build test WARNING on linus/master v6.10-rc1 next-20240528]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Alexander-Stein/drm-bridge-imx93-mipi-dsi-Use-dev_err_probe/20240528-174332
base:   https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git for-next
patch link:    https://lore.kernel.org/r/20240528093922.194684-1-alexander.stein%40ew.tq-group.com
patch subject: [PATCH 1/1] drm/bridge: imx93-mipi-dsi: Use dev_err_probe
config: arm-randconfig-001-20240528 (https://download.01.org/0day-ci/archive/20240528/202405282314.dvr8cFY0-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240528/202405282314.dvr8cFY0-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405282314.dvr8cFY0-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c: In function 'imx93_dsi_probe':
>> drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c:837:13: warning: unused variable 'ret' [-Wunused-variable]
     837 |         int ret;
         |             ^~~


vim +/ret +837 drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c

ce62f8ea7e3f8a8 Liu Ying        2023-08-21  831  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  832  static int imx93_dsi_probe(struct platform_device *pdev)
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  833  {
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  834  	struct device *dev = &pdev->dev;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  835  	struct device_node *np = dev->of_node;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  836  	struct imx93_dsi *dsi;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21 @837  	int ret;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  838  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  839  	dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  840  	if (!dsi)
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  841  		return -ENOMEM;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  842  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  843  	dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
b407e810c9a5b87 Alexander Stein 2024-05-28  844  	if (IS_ERR(dsi->regmap))
b407e810c9a5b87 Alexander Stein 2024-05-28  845  		return dev_err_probe(dev, PTR_ERR(dsi->regmap),
b407e810c9a5b87 Alexander Stein 2024-05-28  846  				     "failed to get block ctrl regmap");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  847  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  848  	dsi->clk_pixel = devm_clk_get(dev, "pix");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  849  	if (IS_ERR(dsi->clk_pixel))
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  850  		return dev_err_probe(dev, PTR_ERR(dsi->clk_pixel),
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  851  				     "failed to get pixel clock\n");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  852  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  853  	dsi->clk_cfg = devm_clk_get(dev, "phy_cfg");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  854  	if (IS_ERR(dsi->clk_cfg))
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  855  		return dev_err_probe(dev, PTR_ERR(dsi->clk_cfg),
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  856  				     "failed to get phy cfg clock\n");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  857  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  858  	dsi->clk_ref = devm_clk_get(dev, "phy_ref");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  859  	if (IS_ERR(dsi->clk_ref))
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  860  		return dev_err_probe(dev, PTR_ERR(dsi->clk_ref),
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  861  				     "failed to get phy ref clock\n");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  862  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  863  	dsi->ref_clk_rate = clk_get_rate(dsi->clk_ref);
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  864  	if (dsi->ref_clk_rate < REF_CLK_RATE_MIN ||
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  865  	    dsi->ref_clk_rate > REF_CLK_RATE_MAX) {
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  866  		dev_err(dev, "invalid phy ref clock rate %lu\n",
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  867  			dsi->ref_clk_rate);
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  868  		return -EINVAL;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  869  	}
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  870  	dev_dbg(dev, "phy ref clock rate: %lu\n", dsi->ref_clk_rate);
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  871  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  872  	dsi->dev = dev;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  873  	dsi->pdata.max_data_lanes = 4;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  874  	dsi->pdata.mode_valid = imx93_dsi_mode_valid;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  875  	dsi->pdata.mode_fixup = imx93_dsi_mode_fixup;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  876  	dsi->pdata.get_input_bus_fmts = imx93_dsi_get_input_bus_fmts;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  877  	dsi->pdata.phy_ops = &imx93_dsi_phy_ops;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  878  	dsi->pdata.host_ops = &imx93_dsi_host_ops;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  879  	dsi->pdata.priv_data = dsi;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  880  	platform_set_drvdata(pdev, dsi);
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  881  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  882  	dsi->dmd = dw_mipi_dsi_probe(pdev, &dsi->pdata);
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  883  	if (IS_ERR(dsi->dmd))
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  884  		return dev_err_probe(dev, PTR_ERR(dsi->dmd),
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  885  				     "failed to probe dw_mipi_dsi\n");
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  886  
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  887  	return 0;
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  888  }
ce62f8ea7e3f8a8 Liu Ying        2023-08-21  889
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
index 2347f8dd632f9..8331db3b4f054 100644
--- a/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/imx/imx93-mipi-dsi.c
@@ -841,11 +841,9 @@  static int imx93_dsi_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	dsi->regmap = syscon_regmap_lookup_by_phandle(np, "fsl,media-blk-ctrl");
-	if (IS_ERR(dsi->regmap)) {
-		ret = PTR_ERR(dsi->regmap);
-		dev_err(dev, "failed to get block ctrl regmap: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(dsi->regmap))
+		return dev_err_probe(dev, PTR_ERR(dsi->regmap),
+				     "failed to get block ctrl regmap");
 
 	dsi->clk_pixel = devm_clk_get(dev, "pix");
 	if (IS_ERR(dsi->clk_pixel))