From patchwork Mon Jun 5 12:06:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9766081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 96ED760353 for ; Mon, 5 Jun 2017 12:06:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B41427D4A for ; Mon, 5 Jun 2017 12:06:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FEA427E63; Mon, 5 Jun 2017 12:06:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26B3927D4A for ; Mon, 5 Jun 2017 12:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751290AbdFEMGp (ORCPT ); Mon, 5 Jun 2017 08:06:45 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33929 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbdFEMGo (ORCPT ); Mon, 5 Jun 2017 08:06:44 -0400 Received: by mail-pg0-f65.google.com with SMTP id v14so5880093pgn.1; Mon, 05 Jun 2017 05:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ZLKxSups1opAYOF3uHW5hDsCIwf01eYPJGI36XkCbPY=; b=Emm+pG4tk1YMoBbH/zsNKj7lQh2DyFK9G1phBxJOxejQLkCMZvV1WjHPbd8C/V0+Dj OhWLpiulTNbhP9h8CFsqK9CAo4bC3z0Z61JSgxxAITgiutLM1tMMjyVPEUuDEB6viOIW W21a+wTf+wLkXHsIDvv4R1l+qSaL2Kpe1wA9M2tqHjHjNKE00e1f2dpgYeZ9zw+ET3ck sMas/UgXU+z0FGS0WkUIvjzw1E8v+hJV/hjDufuODjJWaQl9rZ/1l6Su5co9H2bdU7DK TTb83VUdW7yBkGtmZP47ksuAZBKulTq0kwBFCV+mMQESUsYXHxGa22x8mlaSs8ZxHBfR cnUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZLKxSups1opAYOF3uHW5hDsCIwf01eYPJGI36XkCbPY=; b=ojWEvoHKJjVfl6sBrZo0y48END6QMFs78lX4UvLX2MP81fdarkoUWNHHfL6MtS4ECJ u1RY/v+USE5q99qzhUNNSuOGUKpls5c/jO0elnuCqF7L5XtT2oCpJkGD0hcPTjbu1gEv dGew+bhod4T8nsVNN13i4mwXdvscDes0WkuzG2aBRpf5VYksU0Igz4ul+iyAiYpDfo3b Bci6ZKYKf24sx2WzyqXWfMQJ2ZgoKL2jpbzNj2Smqu8IE7wm2NRzdRHYpC+xMotkDpTL nyyFaIWzEQV77uFY9ehvZWR/F4BSZn4egoh7zdDMdRu7yzglsIVcD1SCCkdLOUdaCEYL kVEw== X-Gm-Message-State: AODbwcDHKod5ncFAPeNwWgDVtLqIB5XylH3Vks0u+0t1MAZYjq3xVgkF xiHdCz/9Zrgi0A== X-Received: by 10.99.138.199 with SMTP id y190mr17124416pgd.187.1496664404218; Mon, 05 Jun 2017 05:06:44 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.zebra.lan ([223.31.70.102]) by smtp.googlemail.com with ESMTPSA id 80sm61508802pfl.89.2017.06.05.05.06.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 05:06:43 -0700 (PDT) From: Arvind Yadav To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: davinci: Handle return value of clk_prepare_enable Date: Mon, 5 Jun 2017 17:36:28 +0530 Message-Id: <29e25f858e455379c529a33842bcfafcbb110337.1496664276.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- drivers/spi/spi-davinci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 595acdc..2b0805d 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -965,7 +965,9 @@ static int davinci_spi_probe(struct platform_device *pdev) ret = -ENODEV; goto free_master; } - clk_prepare_enable(dspi->clk); + ret = clk_prepare_enable(dspi->clk); + if (ret) + goto free_master; master->dev.of_node = pdev->dev.of_node; master->bus_num = pdev->id;