Re: [PATCH 2/4] pinctrl: at91: Fix failure path in at91_gpio_probe path

From: Linus Walleij
Date: Fri Sep 05 2014 - 04:22:32 EST


On Sun, Aug 31, 2014 at 1:21 PM, Pramod Gurav
<pramod.gurav@xxxxxxxxxxxxxxx> wrote:

> This fixes the whole error handling in probe function by capturing and
> returning error values on kernel function like clk_prepare,
> clk_enable, gpiochip_add etc.
>
> CC: Jean-Christophe Plagniol-Villard <plagnioj@xxxxxxxxxxxx>
> CC: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Signed-off-by: Pramod Gurav <pramod.gurav@xxxxxxxxxxxxxxx>
> ---
> drivers/pinctrl/pinctrl-at91.c | 20 +++++++++++++-------
> 1 files changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
> index 480460d..7abe683 100644
> --- a/drivers/pinctrl/pinctrl-at91.c
> +++ b/drivers/pinctrl/pinctrl-at91.c
> @@ -1578,16 +1578,19 @@ static int at91_gpio_probe(struct platform_device *pdev)
> at91_chip->clock = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(at91_chip->clock)) {
> dev_err(&pdev->dev, "failed to get clock, ignoring.\n");
> + ret = IS_ERR(at91_chip->clock);

No. IS_ERR() returns a bool.

You want to use PTR_ERR().

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/