From patchwork Sat Jul 22 20:25:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9858187 X-Patchwork-Delegate: bhelgaas@google.com 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 C2680600F5 for ; Sat, 22 Jul 2017 20:25:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9685628514 for ; Sat, 22 Jul 2017 20:25:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88D1D28518; Sat, 22 Jul 2017 20:25:34 +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 128BB28514 for ; Sat, 22 Jul 2017 20:25:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751328AbdGVUZd (ORCPT ); Sat, 22 Jul 2017 16:25:33 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:36873 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751314AbdGVUZc (ORCPT ); Sat, 22 Jul 2017 16:25:32 -0400 Received: by mail-qt0-f195.google.com with SMTP id n43so9119280qtc.4 for ; Sat, 22 Jul 2017 13:25:32 -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=TZ2kR1diIthCkK2l6er7BlcGYmcjn6nvEF4lnFuBK90=; b=qg2ZRCc3pccwog2+8065Fo2mLAAgKGDsf5r9Kb7SRU2aPKdx+0/CItEYpN13AJue3D BB1ZZ8mZpIeCg5Vkxext88pLAiIqJi95LTo2L9vzCAfcUqwguFHlkm5pzwwpioZkQUlp aMdtHCGs02/Ql7M7tAk6sPsD7Y0QWPOWD1zeSayTMqHpg15kbOH6o5YBc3rtb33IC6/f aGanyF8zDrgOSrjIPQpUSod6P0KUdrfbt7LHFYDORmmOt+mmbAS/GkUQnsZX7cEWIUSv gH4xYQiTNZ90ZZDWgHwQm5WpfTZ3aDj0AyYCJanPZjIwHtLe3GNx0Iz+9w0OIAfiFYNb ZqaA== 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=TZ2kR1diIthCkK2l6er7BlcGYmcjn6nvEF4lnFuBK90=; b=QsBPj+g/9EzkqsYOIaXzL430Ly3rEfJsa7MKjOr8eu7BvJoPe/8iO6F4o+OVCihdNZ Obu1xnxmOHg0rw0V6AAA4yZG4Pjbe02d+Ezd1pBLq6R6sf2xSrF/jVMksZA4M5Z9Hd1X xtNmaULvPUNSRnm0sQKrY/0HaqGe2/HJeO+/g2yAotsY6UvM+FpzSvpcIwHdInn17Own sMSR/40mY/HQn5lcpIX/18rKKLywgl9qLDOzwSfk4cxAghL+wtXY8DgubSuvieMfq1uq HCTCkkID1X7Y74WccZebDgIt7yrt2zaSBjo1KQcnp2QJzuqE7rq71pCpfiMh80ws5zNT 4fYw== X-Gm-Message-State: AIVw111FH+mbCJKW1VlkxQ2si45xtWTzuoHj/2nO01HGrklwH+SukXV6 m54f2QNmtRAcEw== X-Received: by 10.237.58.167 with SMTP id o36mr15874895qte.128.1500755131950; Sat, 22 Jul 2017 13:25:31 -0700 (PDT) Received: from localhost.localdomain ([189.61.213.245]) by smtp.gmail.com with ESMTPSA id 59sm5640897qtc.35.2017.07.22.13.25.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Jul 2017 13:25:31 -0700 (PDT) From: Fabio Estevam To: bhelgaas@google.com Cc: thomas.petazzoni@free-electrons.com, linux-pci@vger.kernel.org, Fabio Estevam Subject: [PATCH v2] PCI: armada8k: Check the return value from clk_prepare_enable() Date: Sat, 22 Jul 2017 17:25:19 -0300 Message-Id: <1500755119-19983-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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 Acked-by: Thomas Petazzoni --- Changes since v1: - Improve Subject style drivers/pci/dwc/pcie-armada8k.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/dwc/pcie-armada8k.c b/drivers/pci/dwc/pcie-armada8k.c index ea8f34a..7297223 100644 --- a/drivers/pci/dwc/pcie-armada8k.c +++ b/drivers/pci/dwc/pcie-armada8k.c @@ -226,7 +226,9 @@ static int armada8k_pcie_probe(struct platform_device *pdev) if (IS_ERR(pcie->clk)) return PTR_ERR(pcie->clk); - clk_prepare_enable(pcie->clk); + ret = clk_prepare_enable(pcie->clk); + if (ret) + return ret; /* Get the dw-pcie unit configuration/control registers base. */ base = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctrl");