diff mbox series

drm/tegra: sor: Make use of the helper function dev_err_probe()

Message ID 20210916105648.12268-1-caihuoqing@baidu.com (mailing list archive)
State New, archived
Headers show
Series drm/tegra: sor: Make use of the helper function dev_err_probe() | expand

Commit Message

Cai,Huoqing Sept. 16, 2021, 10:56 a.m. UTC
When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
And using dev_err_probe() can reduce code size, the error value
gets printed.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/gpu/drm/tegra/sor.c | 24 +++++++++---------------
 1 file changed, 9 insertions(+), 15 deletions(-)

Comments

kernel test robot Sept. 16, 2021, 5:07 p.m. UTC | #1
Hi Cai,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on v5.15-rc1 next-20210916]
[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]

url:    https://github.com/0day-ci/linux/commits/Cai-Huoqing/drm-tegra-sor-Make-use-of-the-helper-function-dev_err_probe/20210916-190458
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm-buildonly-randconfig-r002-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c8b3d7d6d6de37af68b2f379d0e37304f78e115f)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/a212d420986fc0e557d2ae8435995c7009754d40
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Cai-Huoqing/drm-tegra-sor-Make-use-of-the-helper-function-dev_err_probe/20210916-190458
        git checkout a212d420986fc0e557d2ae8435995c7009754d40
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/gpu/drm/tegra/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/gpu/drm/tegra/sor.c:2969:41: error: expected ';' after return statement
                                        "cannot get AVDD I/O supply\n")
                                                                       ^
                                                                       ;
   1 error generated.


vim +2969 drivers/gpu/drm/tegra/sor.c

  2961	
  2962	static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
  2963	{
  2964		int err;
  2965	
  2966		sor->avdd_io_supply = devm_regulator_get(sor->dev, "avdd-io-hdmi-dp");
  2967		if (IS_ERR(sor->avdd_io_supply))
  2968			return dev_err_probe(sor->dev, PTR_ERR(sor->avdd_io_supply),
> 2969					     "cannot get AVDD I/O supply\n")
  2970	
  2971		err = tegra_sor_enable_regulator(sor, sor->avdd_io_supply);
  2972		if (err < 0) {
  2973			dev_err(sor->dev, "failed to enable AVDD I/O supply: %d\n",
  2974				err);
  2975			return err;
  2976		}
  2977	
  2978		sor->vdd_pll_supply = devm_regulator_get(sor->dev, "vdd-hdmi-dp-pll");
  2979		if (IS_ERR(sor->vdd_pll_supply))
  2980			return dev_err_probe(sor->dev, PTR_ERR(sor->vdd_pll_supply),
  2981					     "cannot get VDD PLL supply\n");
  2982	
  2983		err = tegra_sor_enable_regulator(sor, sor->vdd_pll_supply);
  2984		if (err < 0) {
  2985			dev_err(sor->dev, "failed to enable VDD PLL supply: %d\n",
  2986				err);
  2987			return err;
  2988		}
  2989	
  2990		sor->hdmi_supply = devm_regulator_get(sor->dev, "hdmi");
  2991		if (IS_ERR(sor->hdmi_supply))
  2992			return dev_err_probe(sor->dev, PTR_ERR(sor->hdmi_supply),
  2993					     "cannot get HDMI supply\n");
  2994	
  2995		err = tegra_sor_enable_regulator(sor, sor->hdmi_supply);
  2996		if (err < 0) {
  2997			dev_err(sor->dev, "failed to enable HDMI supply: %d\n", err);
  2998			return err;
  2999		}
  3000	
  3001		INIT_DELAYED_WORK(&sor->scdc, tegra_sor_hdmi_scdc_work);
  3002	
  3003		return 0;
  3004	}
  3005	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index 0ea320c1092b..d7964e498da9 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -2964,11 +2964,9 @@  static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 	int err;
 
 	sor->avdd_io_supply = devm_regulator_get(sor->dev, "avdd-io-hdmi-dp");
-	if (IS_ERR(sor->avdd_io_supply)) {
-		dev_err(sor->dev, "cannot get AVDD I/O supply: %ld\n",
-			PTR_ERR(sor->avdd_io_supply));
-		return PTR_ERR(sor->avdd_io_supply);
-	}
+	if (IS_ERR(sor->avdd_io_supply))
+		return dev_err_probe(sor->dev, PTR_ERR(sor->avdd_io_supply),
+				     "cannot get AVDD I/O supply\n")
 
 	err = tegra_sor_enable_regulator(sor, sor->avdd_io_supply);
 	if (err < 0) {
@@ -2978,11 +2976,9 @@  static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 	}
 
 	sor->vdd_pll_supply = devm_regulator_get(sor->dev, "vdd-hdmi-dp-pll");
-	if (IS_ERR(sor->vdd_pll_supply)) {
-		dev_err(sor->dev, "cannot get VDD PLL supply: %ld\n",
-			PTR_ERR(sor->vdd_pll_supply));
-		return PTR_ERR(sor->vdd_pll_supply);
-	}
+	if (IS_ERR(sor->vdd_pll_supply))
+		return dev_err_probe(sor->dev, PTR_ERR(sor->vdd_pll_supply),
+				     "cannot get VDD PLL supply\n");
 
 	err = tegra_sor_enable_regulator(sor, sor->vdd_pll_supply);
 	if (err < 0) {
@@ -2992,11 +2988,9 @@  static int tegra_sor_hdmi_probe(struct tegra_sor *sor)
 	}
 
 	sor->hdmi_supply = devm_regulator_get(sor->dev, "hdmi");
-	if (IS_ERR(sor->hdmi_supply)) {
-		dev_err(sor->dev, "cannot get HDMI supply: %ld\n",
-			PTR_ERR(sor->hdmi_supply));
-		return PTR_ERR(sor->hdmi_supply);
-	}
+	if (IS_ERR(sor->hdmi_supply))
+		return dev_err_probe(sor->dev, PTR_ERR(sor->hdmi_supply),
+				     "cannot get HDMI supply\n");
 
 	err = tegra_sor_enable_regulator(sor, sor->hdmi_supply);
 	if (err < 0) {