From patchwork Sat Jul 22 20:24:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9858185 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 03F93600F5 for ; Sat, 22 Jul 2017 20:24:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C489F28514 for ; Sat, 22 Jul 2017 20:24:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A988928518; Sat, 22 Jul 2017 20:24: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 35DE528514 for ; Sat, 22 Jul 2017 20:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750864AbdGVUYV (ORCPT ); Sat, 22 Jul 2017 16:24:21 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:33536 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750735AbdGVUYV (ORCPT ); Sat, 22 Jul 2017 16:24:21 -0400 Received: by mail-qt0-f193.google.com with SMTP id 50so9131348qtz.0 for ; Sat, 22 Jul 2017 13:24:21 -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=SOLU/GFNLIhmdQEr6ww7CDeUE69cJAGLesEQGQ9GdCo=; b=ImOnY6R3GgnXSVXJYA/nsXXolOrNFHEdeQ7wIHeojQwYL9zq9Y6jsclQQV5aiZ45Gs aeauZ3VfN+1U4I9j+Osss023kpqtBvKxAralgGx3paKJeI0HpAGVPzpqPtbtPhjy4kZX Wf2t4RPRtYJ9z7WYJiLPLTHuRuPoYrJYmexmbMgwYPIspLAdIvfMy4GjnVWMPJIrPVKq Lobt+dKzk+oCeHfVDNCeBEtPiTRjnoBusgujFSNtwwOsUD6YHFd1SuPk03tG5yTyMnB4 hWwgFyvVAwOfkhyavOhH0EhW4GRHaZ83FXsg0leS83z+17F7HfSa7zzC+ew666Ajlmm5 RO5g== 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=SOLU/GFNLIhmdQEr6ww7CDeUE69cJAGLesEQGQ9GdCo=; b=GtvMYjc5cIuEgFk4AaHB9DmAb3BhYSfRdBNBQitkBz+jkF2HBKeG5afuTELDVZ2eWK kzYPYRwxMomDSzkx/Kq2ZzlMhSngCrrTnw8DXxMJ19HixEHEyy3uSgromnBarh6/pHl1 MprgWBS6ZA01aCdJEzBX/U8Lwv7i8HTIy5S2nU2/5uEPc2CAh9iwzM3Q1U17QmfeLQgK StFh9HmLv+eq+u8HmSHvKXYoyBkb68BR3BNRZ/sHZfBJDO8R7SluqDA8y5+D+vhU7Itu qDMSIutXXds695UOuGDdcHoyh7n7zyr5GK5o6ldPmqOOypeLUqn+9HuFoEwgbNUqo9Z8 mn9w== X-Gm-Message-State: AIVw1139KB+DeKLT+WdzmGOlczpXPy9LuXVjl4FmTRZzlOYdrsb5wnyy wrlUsrAg4lxT/g== X-Received: by 10.200.53.232 with SMTP id l37mr14537277qtb.7.1500755060705; Sat, 22 Jul 2017 13:24:20 -0700 (PDT) Received: from localhost.localdomain ([189.61.213.245]) by smtp.gmail.com with ESMTPSA id b11sm5669005qtb.87.2017.07.22.13.24.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Jul 2017 13:24:19 -0700 (PDT) From: Fabio Estevam To: bhelgaas@google.com Cc: thomas.petazzoni@free-electrons.com, linux-pci@vger.kernel.org, Fabio Estevam Subject: [PATCH] pciarmada: Check the return value from clk_prepare_enable() Date: Sat, 22 Jul 2017 17:24:02 -0300 Message-Id: <1500755042-19919-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 --- 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");