rtc: asm9260: add the missed check for devm_clk_get
diff mbox series

Message ID 20191214074528.16806-1-hslester96@gmail.com
State Accepted
Headers show
Series
  • rtc: asm9260: add the missed check for devm_clk_get
Related show

Commit Message

Chuhong Yuan Dec. 14, 2019, 7:45 a.m. UTC
The driver misses a check for devm_clk_get().
Add the check to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/rtc/rtc-asm9260.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Alexandre Belloni Dec. 23, 2019, 10:07 a.m. UTC | #1
On 14/12/2019 15:45:28+0800, Chuhong Yuan wrote:
> The driver misses a check for devm_clk_get().
> Add the check to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  drivers/rtc/rtc-asm9260.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
Applied, thanks.

Patch
diff mbox series

diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
index 10064bdabdff..3ab81cdec00b 100644
--- a/drivers/rtc/rtc-asm9260.c
+++ b/drivers/rtc/rtc-asm9260.c
@@ -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");