Message ID | 1441940576-4972-1-git-send-email-pingbo.wen@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Sep 11, 2015 at 12:02 AM, WEN Pingbo <pingbo.wen@linaro.org> wrote: > - 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); Shouldn't you add a 'return' here to prevent the code to proceed with the failed clock? -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Friday, September 11, 2015 11:10 AM, Fabio Estevam wrote: > On Fri, Sep 11, 2015 at 12:02 AM, WEN Pingbo <pingbo.wen@linaro.org> wrote: > >> - 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); > Shouldn't you add a 'return' here to prevent the code to proceed with > the failed clock? Yes, it should be there. I will re-send the patch. Thank you. -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c index 2e4ff5b..aebb996 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,10 @@ 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); psif_writel(psif, PSR, prscv); clk_disable(psif->pclk); }
We should print the err if clk_enable failed. Signed-off-by: WEN Pingbo <pingbo.wen@linaro.org> --- drivers/input/serio/at32psif.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)