From patchwork Sun Aug 27 16:30:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9923949 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 AE4FC60329 for ; Sun, 27 Aug 2017 16:31:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1F85285DE for ; Sun, 27 Aug 2017 16:31:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96E0E28634; Sun, 27 Aug 2017 16:31:09 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 534FA285DE for ; Sun, 27 Aug 2017 16:31:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751255AbdH0QbH (ORCPT ); Sun, 27 Aug 2017 12:31:07 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:36867 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbdH0QbG (ORCPT ); Sun, 27 Aug 2017 12:31:06 -0400 Received: by mail-qt0-f194.google.com with SMTP id g13so3490537qta.4 for ; Sun, 27 Aug 2017 09:31:06 -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:in-reply-to:references; bh=+0URkxciZDGFekXMSkPPCC2OE1y6XJBi7VYBmhW9YVw=; b=uHXFtOTdpHJlIv/wAiJdlignBQMc0xyRlrOhGKu4ye4QijeDx9/XfHWmSt0ZDtigsa rkfkYh+UiO1q5cyyDobUbpyJC8H+azhhQb315K0OMVg6dTPNyizsBMAV7/vHOBhQ8INP 1sLmnMMhW7FKb69wktZc2oxYuSomt5f9sfiShBBaWrLyu4XNm66nCUfIkjsFBBeNjnaU OUis8F5w9h20IC6V0mmyMl3tEWuWFf4rcT1gXP5AIWINza6/bPvB8JPf0Q2117fMS0IN 0I+y0wWZMNmYe4wYrDOy60AxoCJ1UpQoYOQiI59ibNw2cqz7gJns/uXAlj5tVV2USoQb jmAg== 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:in-reply-to :references; bh=+0URkxciZDGFekXMSkPPCC2OE1y6XJBi7VYBmhW9YVw=; b=EQSm409+5dkyx4UN+pu5r33qq3aB1sWGd9vplFVpqAb0qz7oGOeNgQ+SfMyeT9jAGD 79gu2dT1Zs4mwkbsjGJUZbYn8IuRw6Yz31stzOQEQTdBVKgc+L/hGz3rZFpQ41wiYM8E 4OoTe83VVyQanaNGsER7TYt+bhdfoJYKg2bWOSIk8m+SszmhID8oasSrZS3ZU8H0NfOI ell9s21qpx/NrivxqW3XMOJ4hp56zlCN9XyaTgtajKI2c1C/Czg3zCCwbSebkiwGA7p8 llS2rXeRlg508i5y9aTahpscLB8hm/2z7RWGqMEf+2kwRbSARs80eSN3A+KeXc03v2pw N0cg== X-Gm-Message-State: AHYfb5gVlnQowiZZuMgWKkI2Mm/t13plS1KnoliZQo18DUEJtHaZAmdw EUfuOXZufTZEkA== X-Received: by 10.237.63.131 with SMTP id s3mr5955377qth.90.1503851465596; Sun, 27 Aug 2017 09:31:05 -0700 (PDT) Received: from localhost.localdomain ([187.180.183.214]) by smtp.gmail.com with ESMTPSA id f187sm6952640qkb.97.2017.08.27.09.31.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 27 Aug 2017 09:31:05 -0700 (PDT) From: Fabio Estevam To: mchehab@kernel.org Cc: hans.verkuil@cisco.com, sakari.ailus@linux.intel.com, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH 4/4] [media] ov2640: Check the return value from clk_prepare_enable() Date: Sun, 27 Aug 2017 13:30:38 -0300 Message-Id: <1503851438-4949-4-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503851438-4949-1-git-send-email-festevam@gmail.com> References: <1503851438-4949-1-git-send-email-festevam@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam clk_prepare_enable() may fail, so we should better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam --- drivers/media/i2c/ov2640.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov2640.c b/drivers/media/i2c/ov2640.c index e6cbe01..5f013c8 100644 --- a/drivers/media/i2c/ov2640.c +++ b/drivers/media/i2c/ov2640.c @@ -1108,7 +1108,9 @@ static int ov2640_probe(struct i2c_client *client, priv->clk = devm_clk_get(&client->dev, "xvclk"); if (IS_ERR(priv->clk)) return PTR_ERR(priv->clk); - clk_prepare_enable(priv->clk); + ret = clk_prepare_enable(priv->clk); + if (ret) + return ret; } ret = ov2640_probe_dt(client, priv);