Skip to contentSkip to conversation

rtc: asm9260: add the missed check for devm_clk_get

PATCH Applied Chuhong Yuan 2 participants 2 messages Dec 14, 2019 – Dec 23, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: asm9260: add the missed check for devm_clk_get

The driver misses a check for devm_clk_get().
Add the check to fix it.

---
 drivers/rtc/rtc-asm9260.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/rtc/rtc-asm9260.c +3 -0
index 10064bdabdff..3ab81cdec00b 100644
@@ -264,6 +264,9 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->iobase);
 
 	priv->clk = devm_clk_get(dev, "ahb");
+	if (IS_ERR(priv->clk))
+		return PTR_ERR(priv->clk);
+
 	ret = clk_prepare_enable(priv->clk);
 	if (ret) {
 		dev_err(dev, "Failed to enable clk!\n");
Signature · 1 line
2.24.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Chuhong Yuan

The driver misses a check for devm_clk_get().
Add the check to fix it.

---
 drivers/rtc/rtc-asm9260.c | 3 +++
 1 file changed, 3 insertions(+)

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com