CC: kbuild-all(a)lists.01.org In-Reply-To: <20220105090225.20507-1-linmq006@gmail.com> References: <20220105090225.20507-1-linmq006@gmail.com> TO: Miaoqian Lin CC: linmq006(a)gmail.com CC: Kishon Vijay Abraham I CC: Vinod Koul CC: Randy Dunlap CC: Roger Quadros CC: linux-phy(a)lists.infradead.org CC: linux-kernel(a)vger.kernel.org Hi Miaoqian, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.16-rc8 next-20220105] [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/Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git c9e6606c7fe92b50a02ce51dda82586ebdf99b48 :::::: branch date: 9 hours ago :::::: commit date: 9 hours ago config: microblaze-randconfig-s031-20220105 (https://download.01.org/0day-ci/archive/20220106/202201060123.PR3DWie4-lkp(a)intel.com/config) compiler: microblaze-linux-gcc (GCC) 11.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-dirty # https://github.com/0day-ci/linux/commit/dc404b65a54364bb2937baba85bb37960c514167 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Miaoqian-Lin/phy-ti-Add-missing-pm_runtime_disable-in-probe-function/20220105-170334 git checkout dc404b65a54364bb2937baba85bb37960c514167 # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/phy/ti/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) >> drivers/phy/ti/phy-am654-serdes.c:841:1: sparse: sparse: unused label 'err_pm_disable' vim +/err_pm_disable +841 drivers/phy/ti/phy-am654-serdes.c 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 751 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 752 static int serdes_am654_probe(struct platform_device *pdev) 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 753 { 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 754 struct phy_provider *phy_provider; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 755 struct device *dev = &pdev->dev; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 756 struct device_node *node = dev->of_node; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 757 struct clk_onecell_data *clk_data; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 758 struct serdes_am654 *am654_phy; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 759 struct mux_control *control; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 760 const char *clock_name; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 761 struct regmap *regmap; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 762 void __iomem *base; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 763 struct phy *phy; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 764 int ret; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 765 int i; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 766 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 767 am654_phy = devm_kzalloc(dev, sizeof(*am654_phy), GFP_KERNEL); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 768 if (!am654_phy) 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 769 return -ENOMEM; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 770 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 771 base = devm_platform_ioremap_resource(pdev, 0); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 772 if (IS_ERR(base)) 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 773 return PTR_ERR(base); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 774 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 775 regmap = devm_regmap_init_mmio(dev, base, &serdes_am654_regmap_config); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 776 if (IS_ERR(regmap)) { 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 777 dev_err(dev, "Failed to initialize regmap\n"); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 778 return PTR_ERR(regmap); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 779 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 780 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 781 control = devm_mux_control_get(dev, NULL); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 782 if (IS_ERR(control)) 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 783 return PTR_ERR(control); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 784 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 785 am654_phy->dev = dev; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 786 am654_phy->of_node = node; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 787 am654_phy->regmap = regmap; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 788 am654_phy->control = control; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 789 am654_phy->type = PHY_NONE; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 790 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 791 ret = serdes_am654_regfield_init(am654_phy); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 792 if (ret) { 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 793 dev_err(dev, "Failed to initialize regfields\n"); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 794 return ret; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 795 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 796 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 797 platform_set_drvdata(pdev, am654_phy); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 798 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 799 for (i = 0; i < SERDES_NUM_CLOCKS; i++) { 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 800 ret = of_property_read_string_index(node, "clock-output-names", 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 801 i, &clock_name); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 802 if (ret) { 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 803 dev_err(dev, "Failed to get clock name\n"); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 804 return ret; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 805 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 806 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 807 ret = serdes_am654_clk_register(am654_phy, clock_name, i); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 808 if (ret) { 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 809 dev_err(dev, "Failed to initialize clock %s\n", 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 810 clock_name); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 811 return ret; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 812 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 813 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 814 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 815 clk_data = &am654_phy->clk_data; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 816 clk_data->clks = am654_phy->clks; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 817 clk_data->clk_num = SERDES_NUM_CLOCKS; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 818 ret = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 819 if (ret) 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 820 return ret; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 821 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 822 pm_runtime_enable(dev); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 823 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 824 phy = devm_phy_create(dev, NULL, &ops); 850280156f6421 Dan Carpenter 2020-09-05 825 if (IS_ERR(phy)) { 850280156f6421 Dan Carpenter 2020-09-05 826 ret = PTR_ERR(phy); 850280156f6421 Dan Carpenter 2020-09-05 827 goto clk_err; 850280156f6421 Dan Carpenter 2020-09-05 828 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 829 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 830 phy_set_drvdata(phy, am654_phy); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 831 phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 832 if (IS_ERR(phy_provider)) { 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 833 ret = PTR_ERR(phy_provider); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 834 goto clk_err; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 835 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 836 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 837 return 0; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 838 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 839 clk_err: 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 840 of_clk_del_provider(node); dc404b65a54364 Miaoqian Lin 2022-01-05 @841 err_pm_disable: dc404b65a54364 Miaoqian Lin 2022-01-05 842 pm_runtime_disable(dev); 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 843 return ret; 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 844 } 71e2f5c5c2249d Kishon Vijay Abraham I 2019-04-17 845 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org