[PATCH v2 2/5] clk: mediatek: Add mt8173-mfgtop driver
Dan Carpenter
dan.carpenter at linaro.org
Thu Mar 26 00:58:27 PDT 2026
Hi Chen-Yu,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Chen-Yu-Tsai/dt-bindings-clock-mediatek-Add-mt8173-mfgtop/20260325-202618
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
patch link: https://lore.kernel.org/r/20260325071951.544031-3-wenst%40chromium.org
patch subject: [PATCH v2 2/5] clk: mediatek: Add mt8173-mfgtop driver
config: csky-randconfig-r073-20260326 (https://download.01.org/0day-ci/archive/20260326/202603261444.jANdMbNC-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 11.5.0
smatch: v0.5.0-9004-gb810ac53
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 at intel.com>
| Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
| Closes: https://lore.kernel.org/r/202603261444.jANdMbNC-lkp@intel.com/
smatch warnings:
drivers/clk/mediatek/clk-mt8173-mfgtop.c:163 clk_mt8173_mfgtop_probe() warn: missing error code 'ret'
vim +/ret +163 drivers/clk/mediatek/clk-mt8173-mfgtop.c
edc2074329e271 Chen-Yu Tsai 2026-03-25 153 ret = mtk_clk_register_gates(dev, node, mfg_clks, ARRAY_SIZE(mfg_clks),
edc2074329e271 Chen-Yu Tsai 2026-03-25 154 data->clk_data);
edc2074329e271 Chen-Yu Tsai 2026-03-25 155 if (ret) {
edc2074329e271 Chen-Yu Tsai 2026-03-25 156 dev_err_probe(dev, ret, "Failed to register clock gates\n");
edc2074329e271 Chen-Yu Tsai 2026-03-25 157 goto put_pm_runtime;
edc2074329e271 Chen-Yu Tsai 2026-03-25 158 }
edc2074329e271 Chen-Yu Tsai 2026-03-25 159
edc2074329e271 Chen-Yu Tsai 2026-03-25 160 data->clk_26m = clk_hw_get_clk(data->clk_data->hws[CLK_MFG_26M], "26m");
edc2074329e271 Chen-Yu Tsai 2026-03-25 161 if (IS_ERR(data->clk_26m)) {
edc2074329e271 Chen-Yu Tsai 2026-03-25 162 dev_err_probe(dev, PTR_ERR(data->clk_26m), "Failed to get 26 MHz clock\n");
edc2074329e271 Chen-Yu Tsai 2026-03-25 @163 goto unregister_clks;
ret = dev_err_probe() or ret = PTR_ERR(data->clk_26m)?
edc2074329e271 Chen-Yu Tsai 2026-03-25 164 }
edc2074329e271 Chen-Yu Tsai 2026-03-25 165
edc2074329e271 Chen-Yu Tsai 2026-03-25 166 ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, data->clk_data);
edc2074329e271 Chen-Yu Tsai 2026-03-25 167 if (ret) {
edc2074329e271 Chen-Yu Tsai 2026-03-25 168 dev_err_probe(dev, ret, "Failed to add clk OF provider\n");
edc2074329e271 Chen-Yu Tsai 2026-03-25 169 goto put_26m_clk;
edc2074329e271 Chen-Yu Tsai 2026-03-25 170 }
edc2074329e271 Chen-Yu Tsai 2026-03-25 171
edc2074329e271 Chen-Yu Tsai 2026-03-25 172 data->genpd.name = "mfg-top";
edc2074329e271 Chen-Yu Tsai 2026-03-25 173 data->genpd.power_on = clk_mt8173_mfgtop_power_on;
edc2074329e271 Chen-Yu Tsai 2026-03-25 174 data->genpd.power_off = clk_mt8173_mfgtop_power_off;
edc2074329e271 Chen-Yu Tsai 2026-03-25 175 ret = pm_genpd_init(&data->genpd, NULL, true);
edc2074329e271 Chen-Yu Tsai 2026-03-25 176 if (ret) {
edc2074329e271 Chen-Yu Tsai 2026-03-25 177 dev_err_probe(dev, ret, "Failed to add power domain\n");
edc2074329e271 Chen-Yu Tsai 2026-03-25 178 goto del_clk_provider;
edc2074329e271 Chen-Yu Tsai 2026-03-25 179 }
edc2074329e271 Chen-Yu Tsai 2026-03-25 180
edc2074329e271 Chen-Yu Tsai 2026-03-25 181 ret = of_genpd_add_provider_simple(node, &data->genpd);
edc2074329e271 Chen-Yu Tsai 2026-03-25 182 if (ret) {
edc2074329e271 Chen-Yu Tsai 2026-03-25 183 dev_err_probe(dev, ret, "Failed to add power domain OF provider\n");
edc2074329e271 Chen-Yu Tsai 2026-03-25 184 goto remove_pd;
edc2074329e271 Chen-Yu Tsai 2026-03-25 185 }
edc2074329e271 Chen-Yu Tsai 2026-03-25 186
edc2074329e271 Chen-Yu Tsai 2026-03-25 187 ret = of_genpd_add_subdomain(&data->parent_pd, &data->child_pd);
edc2074329e271 Chen-Yu Tsai 2026-03-25 188 if (ret) {
edc2074329e271 Chen-Yu Tsai 2026-03-25 189 dev_err_probe(dev, ret, "Failed to link PM domains\n");
edc2074329e271 Chen-Yu Tsai 2026-03-25 190 goto del_pd_provider;
edc2074329e271 Chen-Yu Tsai 2026-03-25 191 }
edc2074329e271 Chen-Yu Tsai 2026-03-25 192
edc2074329e271 Chen-Yu Tsai 2026-03-25 193 pm_runtime_put(dev);
edc2074329e271 Chen-Yu Tsai 2026-03-25 194 return 0;
edc2074329e271 Chen-Yu Tsai 2026-03-25 195
edc2074329e271 Chen-Yu Tsai 2026-03-25 196 del_pd_provider:
edc2074329e271 Chen-Yu Tsai 2026-03-25 197 of_genpd_del_provider(node);
edc2074329e271 Chen-Yu Tsai 2026-03-25 198 remove_pd:
edc2074329e271 Chen-Yu Tsai 2026-03-25 199 pm_genpd_remove(&data->genpd);
edc2074329e271 Chen-Yu Tsai 2026-03-25 200 del_clk_provider:
edc2074329e271 Chen-Yu Tsai 2026-03-25 201 of_clk_del_provider(node);
edc2074329e271 Chen-Yu Tsai 2026-03-25 202 put_26m_clk:
edc2074329e271 Chen-Yu Tsai 2026-03-25 203 clk_put(data->clk_26m);
edc2074329e271 Chen-Yu Tsai 2026-03-25 204 unregister_clks:
edc2074329e271 Chen-Yu Tsai 2026-03-25 205 mtk_clk_unregister_gates(mfg_clks, ARRAY_SIZE(mfg_clks), data->clk_data);
edc2074329e271 Chen-Yu Tsai 2026-03-25 206 put_pm_runtime:
edc2074329e271 Chen-Yu Tsai 2026-03-25 207 pm_runtime_put(dev);
edc2074329e271 Chen-Yu Tsai 2026-03-25 208 put_of_node:
edc2074329e271 Chen-Yu Tsai 2026-03-25 209 of_node_put(data->parent_pd.np);
edc2074329e271 Chen-Yu Tsai 2026-03-25 210 return ret;
edc2074329e271 Chen-Yu Tsai 2026-03-25 211 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the Linux-mediatek
mailing list