RE: [PATCH 08/16] ARM: samsung: serial: don't treat NULL clk as anerror

From: Kukjin Kim
Date: Tue Jan 11 2011 - 21:21:24 EST


Jamie Iles wrote:
>
> clk_get() returns a struct clk cookie to the driver and some platforms
> may return NULL if they only support a single clock. clk_get() has only
> failed if it returns a ERR_PTR() encoded pointer.
>
> Cc: Kukjin Kim <kgene.kim@xxxxxxxxxxx>
Acked-by: Kukjin Kim <kgene.kim@xxxxxxxxxxx>

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@xxxxxxxxxxx>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Signed-off-by: Jamie Iles <jamie@xxxxxxxxxxxxx>
> ---
> drivers/serial/samsung.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
> index 7ac2bf5..be93d2f 100644
> --- a/drivers/serial/samsung.c
> +++ b/drivers/serial/samsung.c
> @@ -42,6 +42,7 @@
> #include <linux/serial.h>
> #include <linux/delay.h>
> #include <linux/clk.h>
> +#include <linux/err.h>
> #include <linux/cpufreq.h>
>
> #include <asm/irq.h>
> @@ -522,7 +523,7 @@ static int s3c24xx_serial_calcbaud(struct baud_calc
*calc,
> unsigned long rate;
>
> calc->src = clk_get(port->dev, clksrc->name);
> - if (calc->src == NULL || IS_ERR(calc->src))
> + if (IS_ERR(calc->src))
> return 0;
>
> rate = clk_get_rate(calc->src);
> --
1.7.3.4

--
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/