From patchwork Mon Nov 5 20:45:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10669105 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 55A541709 for ; Mon, 5 Nov 2018 20:45:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 363A229ECA for ; Mon, 5 Nov 2018 20:45:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26C2929ECF; Mon, 5 Nov 2018 20:45:02 +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 D08AF29ECA for ; Mon, 5 Nov 2018 20:45:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730223AbeKFGGa (ORCPT ); Tue, 6 Nov 2018 01:06:30 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:38788 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726578AbeKFGG3 (ORCPT ); Tue, 6 Nov 2018 01:06:29 -0500 Received: by mail-qt1-f193.google.com with SMTP id p17so195482qtl.5 for ; Mon, 05 Nov 2018 12:44:59 -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=ITVinCpJ0nxkpVqDKZheu/1dfB+KYQpYOIkcu7o5Mas=; b=OyzfnKExC1LiHVgngXRuRXVJ6nKulueZCf2DQUuVcLL5jE8glhSL0M7QtkgubrNT1w wgyMb1xGFriun5LGUiN4IGMF5k+NJm45LEcSFzkCKmrmWPdnweEIR9vYW5sjetUpCNtH PLU9EgNf1FZIiV/4ETT58dGsdv0tc8Jf39zxWZ8oQSCX8ARAqIM+mgFpA0g5UQvOZfDD s61y3ZmiGhS2V0SaBUmbw6KVVPhY9V/XyWla2/L6iKKDKXgewTP8IWu4S2fpTEF2uniD r3v2rNB3OTe7fNtEdfOhHzI/dGvIWW80QVCn3Z/s4irivkkFUnGT3s9IfYgA7upzvIZ0 DRCQ== 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=ITVinCpJ0nxkpVqDKZheu/1dfB+KYQpYOIkcu7o5Mas=; b=jz/PP61azBr70A6BLuzlX7BDM03LVCRclLl2g00Wo5dAAyiDVHww/uTKYrNV1YSwg0 v2I2zh9jeKtGsUKCSJDlRhhZxOXcsqIdgvRlXfJf8ZhcOATv7cqr/Q/PbIU56xl793Sj k6gDk15ol51Gtz09pHA9zmNMHRcGUwIRrlbctYe+lVi//bGEEiDLaQHc68kS5xbDgwLC WX8QCrC7+OXOZ4wjIes2Kkx87+lVtnoYkjlujuwzWIdPsGg7TV42rTdu09P19Z8q/jlW /K4Osz1Dg/tkqs7gbp7Ewx8FyzcNB1FDMrfhS251m2SmUKdYxliVwyjg9F6GNfvcUkSP 1KNA== X-Gm-Message-State: AGRZ1gKCZYU5qYOeEKsscBtTLXS+vZWIwcZE5YWKKEC243neGqEDjKXS ybx7kfd4zdn5iaE7yeA6Eza7B/9+ X-Google-Smtp-Source: AJdET5cDfFCSYmJzMtweYfFhh1G9g0ZtlnLsObue2NzdhbR+nhP4v/CnP5MW9iaxejSRVRmUahALOg== X-Received: by 2002:a0c:be8d:: with SMTP id n13mr23023348qvi.143.1541450699314; Mon, 05 Nov 2018 12:44:59 -0800 (PST) Received: from localhost.localdomain ([201.82.144.36]) by smtp.gmail.com with ESMTPSA id 5sm10167968qkv.93.2018.11.05.12.44.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 12:44:58 -0800 (PST) From: Fabio Estevam To: p.zabel@pengutronix.de Cc: mchehab@kernel.org, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH v2 1/3] media: imx-pxp: Check the return value from clk_prepare_enable() Date: Mon, 5 Nov 2018 18:45:14 -0200 Message-Id: <1541450716-25523-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 Reviewed-by: Philipp Zabel --- Changes since v1: - Properly enumerate the series 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);