Thread (5 messages) 5 messages, 2 authors, 2015-09-11

[PATCH V2 1/2] Input: at32psif: handle clk_enable return value

flat view
DORMANTno replies

From: WEN Pingbo <hidden>
Date: 2015-09-11 03:35:39
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

We should print the err if clk_enable failed.

Signed-off-by: WEN Pingbo <redacted>
---
 drivers/input/serio/at32psif.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c
index 2e4ff5b..38862a8 100644
--- a/drivers/input/serio/at32psif.c
+++ b/drivers/input/serio/at32psif.c
@@ -185,6 +185,7 @@ static void psif_set_prescaler(struct psif *psif)
 {
 	unsigned long prscv;
 	unsigned long rate = clk_get_rate(psif->pclk);
+	int retval;
 
 	/* PRSCV = Pulse length (100 us) * PSIF module frequency. */
 	prscv = 100 * (rate / 1000000UL);
@@ -195,7 +196,12 @@ static void psif_set_prescaler(struct psif *psif)
 				"prescaler set to max\n");
 	}
 
-	clk_enable(psif->pclk);
+	retval = clk_enable(psif->pclk);
+	if (retval < 0) {
+		dev_err(&psif->pdev->dev,
+			"could not enable pclk, ret %d\n", retval);
+		return;
+	}
 	psif_writel(psif, PSR, prscv);
 	clk_disable(psif->pclk);
 }
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help