Re: [PATCH v6] pinctrl: stm32: Add check for clk_enable()

From: Marek Vasut
Date: Mon Dec 23 2024 - 14:35:47 EST


On 12/23/24 3:06 AM, Mingwei Zheng wrote:

[...]

Shouldn't the clock be enabled before calling stm32_gpiolib_register_bank() ? I think the clk_bulk_prepare_enable(pctl->nbanks, pctl->clks); should be around here.

@@ -1646,15 +1628,18 @@ int stm32_pctl_probe(struct platform_device *pdev)
if (ret) {
fwnode_handle_put(child);
- for (i = 0; i < pctl->nbanks; i++)
- clk_disable_unprepare(pctl->banks[i].clk);
-
return ret;
}
pctl->nbanks++;
}
+ ret = clk_bulk_prepare_enable(pctl->nbanks, pctl->clks);
+ if (ret) {
+ dev_err(dev, "failed to prepare_enable clk (%d)\n", ret);
+ return ret;
+ }
+
dev_info(dev, "Pinctrl STM32 initialized\n");
return 0;
Aside from that one question, this looks good, thanks !