lkml.org 
[lkml]   [2012]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 49/58] can: mscan-mpc5xxx: fix return value check in mpc512x_can_get_clock()
    Date
    3.5-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

    commit f61bd0585dfc7d99db4936d7467de4ca8e2f7ea0 upstream.

    In case of error, the function clk_get() returns ERR_PTR()
    and never returns NULL pointer. The NULL test in the error
    handling should be replaced with IS_ERR().

    dpatch engine is used to auto generated this patch.
    (https://github.com/weiyj/dpatch)

    Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
    Acked-by: Wolfgang Grandegger <wg@grandegger.com>
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/net/can/mscan/mpc5xxx_can.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/drivers/net/can/mscan/mpc5xxx_can.c
    +++ b/drivers/net/can/mscan/mpc5xxx_can.c
    @@ -181,7 +181,7 @@ static u32 __devinit mpc512x_can_get_clo

    if (!clock_name || !strcmp(clock_name, "sys")) {
    sys_clk = clk_get(&ofdev->dev, "sys_clk");
    - if (!sys_clk) {
    + if (IS_ERR(sys_clk)) {
    dev_err(&ofdev->dev, "couldn't get sys_clk\n");
    goto exit_unmap;
    }
    @@ -204,7 +204,7 @@ static u32 __devinit mpc512x_can_get_clo

    if (clocksrc < 0) {
    ref_clk = clk_get(&ofdev->dev, "ref_clk");
    - if (!ref_clk) {
    + if (IS_ERR(ref_clk)) {
    dev_err(&ofdev->dev, "couldn't get ref_clk\n");
    goto exit_unmap;
    }



    \
     
     \ /
      Last update: 2012-10-05 00:01    [W:4.162 / U:0.820 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site