From patchwork Mon Nov 5 20:33:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10669101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B8F8814BD for ; Mon, 5 Nov 2018 20:32:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85CEA29EBB for ; Mon, 5 Nov 2018 20:32:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76C3D29F14; Mon, 5 Nov 2018 20:32:54 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 1DD1D29EBB for ; Mon, 5 Nov 2018 20:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730207AbeKFFyT (ORCPT ); Tue, 6 Nov 2018 00:54:19 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:34373 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbeKFFyS (ORCPT ); Tue, 6 Nov 2018 00:54:18 -0500 Received: by mail-qt1-f194.google.com with SMTP id r14so148362qtp.1 for ; Mon, 05 Nov 2018 12:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=G/ieJYNzcERaF8AgZLwqE9eUUbsGze+vw8T3WQd9w+4=; b=lHjJuzN/sMWjti9vQYuGGaudfA7O/5z5WqiMZTM+j/ceywdWO5dsENrXH73Ta2pPJ5 uYp7ey7qsPWkiYSfSk2728sowRcM1mlftyO137HssS8+RUL87OgGLUW0r7uv8uD/SX9Y vzfSyiUN7rUFEp1J9ka+eU7pdQmh6x39Q1+zTZsw0lhnl03IaDkBZwl/sYE3m0rE7tYE XOqYCqhAhgLofNkc+68X0GZ/Wh/++MnVQHj3Osi1F9YFmKLmAZfY7kZI1YQjO22hIYU8 AvoURFLekAES1idqUN2gKPzoyya7CFQFscz5bNQIM2HA2g+wrP/ObdW0/gDJUy7n24CH p8bQ== 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=G/ieJYNzcERaF8AgZLwqE9eUUbsGze+vw8T3WQd9w+4=; b=ZmPZ+1m9MVh9MjxivWRBkqKJNQ3p6W7+gMnO0I2wWu3c85rHoIDaCzyFZ0DOnpeE17 JIVrl7x3psatlEvkhZpEmgeJeUf1yK3pBtbxFt4qi6bgyFpJ5LpJ3B7/Q5murWhfHHQK lhvER/gwQBhiQ3CTE7XpRj4mFtRy8+gyd8iswi+SKnsMKIcS8MBecsgJHwUVCu//L9Kg vpVYlOC8v6Sxy3ISyJLS5mjKHhCQCrg15V7azyw5YKiOEsZxw7F5Yp9M5jcFZ84l/gA4 w3UG3/V4Thy4wudvY9H4A3UjgyTE5IvdNhaRmLYoRUtezEj/4dht2J20d4Gc7L9H+JV2 V8cw== X-Gm-Message-State: AGRZ1gL+ov8ywhYCBL962GrefD1gX0XZ+NlidbZ8pRBBS/tS9ZFc4RgD wUSWDUzADIxnVaaCRM+chMQ= X-Google-Smtp-Source: AJdET5eDzCzWsMzETRgJuCzL4XnuoaKYRWbjKHISTvjjSHWLbFWivEGbGqfiaohBrkwDdG8KCmtYEg== X-Received: by 2002:a0c:f787:: with SMTP id s7mr23042209qvn.167.1541449972220; Mon, 05 Nov 2018 12:32:52 -0800 (PST) Received: from localhost.localdomain ([201.82.144.36]) by smtp.gmail.com with ESMTPSA id t43sm3470405qtc.53.2018.11.05.12.32.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 12:32:51 -0800 (PST) From: Fabio Estevam To: p.zabel@pengutronix.de Cc: mchehab@kernel.org, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH] media: imx-pxp: Check the return value from clk_prepare_enable() Date: Mon, 5 Nov 2018 18:33:10 -0200 Message-Id: <1541449991-24768-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 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 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/platform/imx-pxp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c index b76cd0e..27780f1 100644 --- a/drivers/media/platform/imx-pxp.c +++ b/drivers/media/platform/imx-pxp.c @@ -1666,7 +1666,10 @@ static int pxp_probe(struct platform_device *pdev) return ret; } - clk_prepare_enable(dev->clk); + ret = clk_prepare_enable(dev->clk); + if (ret < 0) + return ret; + pxp_soft_reset(dev); spin_lock_init(&dev->irqlock);