From patchwork Wed Dec 26 02:22:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kangjie Lu X-Patchwork-Id: 10742785 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 4C80713BF for ; Wed, 26 Dec 2018 02:23:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ED2A28C1F for ; Wed, 26 Dec 2018 02:23:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20AFC28C27; Wed, 26 Dec 2018 02:23:11 +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,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 1CFDA28C20 for ; Wed, 26 Dec 2018 02:23:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725924AbeLZCXG (ORCPT ); Tue, 25 Dec 2018 21:23:06 -0500 Received: from mta-p6.oit.umn.edu ([134.84.196.206]:36702 "EHLO mta-p6.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725910AbeLZCXG (ORCPT ); Tue, 25 Dec 2018 21:23:06 -0500 Received: from localhost (unknown [127.0.0.1]) by mta-p6.oit.umn.edu (Postfix) with ESMTP id D6156C18 for ; Wed, 26 Dec 2018 02:23:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p6.oit.umn.edu ([127.0.0.1]) by localhost (mta-p6.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gg8fOotKRaud for ; Tue, 25 Dec 2018 20:23:04 -0600 (CST) Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p6.oit.umn.edu (Postfix) with ESMTPS id A5E64BCE for ; Tue, 25 Dec 2018 20:23:04 -0600 (CST) Received: by mail-io1-f69.google.com with SMTP id v8so17852773ioh.11 for ; Tue, 25 Dec 2018 18:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=cu8L5CSVbazjBHbPhWjYELagrYCmPrkJmVmLcFehgX0=; b=di+lNTNeBipjGXK+tGQNXQ/GFr0DTNwP7tNlRS97MCm6cG+SJmaRMJYXkzx717LzlG W1RNE0R1Yy4HYwhv4jcn36HSK76lNe800R/J9FL5VS+/1a+FC8iGODcMUGRFGer6O/ZE ab0brs1g54l3lFgcTXx8N+qVeHiWs3MHlX1v+kVmL7Kzd+NEyZxEij0xQrOGgRqEBrrk PDBfL7MAV348B/SnfBaD6dxPo8o6QFpSBsLtDVEpm+6lbwuROUdhtDoYOYF1ZL1Hi+yI TMDV6li1qKEMW5PhUJz0w6oBJ7gmHqDlzobyeHL4JKW/WL5YYlNpV5iXIHzjxCmS5T/6 5t/g== 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=cu8L5CSVbazjBHbPhWjYELagrYCmPrkJmVmLcFehgX0=; b=YPAJYjT5nSjAzq40rfEfzDscYRUADm22dWOLUECrnvObYloduBlTj/RinQWxoaJKNM cCfQIJdNE9AHVSMpP3Bl7MC3Y3FB3EOVjNTJTxHTTxTVpnGUj5IdUeh6afxTgRNf7jhb YSWcaumPG/6/YsxUOzAd4kuCoRq9wDg9mWkjbiyuXMyLMTwWhWX5hItEaKkBinPwqVjv FKb/p6rIbbbGL+fy2K6Q5FB/u33NaFminjJH14b57SXnpbZi9PrwqWnjG8ZkkavhOzvX c9EnYa+7h7bjWA/o3dGFTF/IjShlLrstSxCIXzp0aoQIKwa47xUTbvgJ/Es6BkdYBlq9 jTjQ== X-Gm-Message-State: AJcUukfkAOMzaZvHg25lYlpBWmTOY/BiNfcuplwTjEsxBVLK8emYHf3G +pa6XB9G1lkwiZa3q6W5gXxPZmRHLtZQaNEILhOC1H8Jjz/ym4XYb624jkZEz0G8H8BNuIN4AOZ UpHt2XKqrdJ3Ps0sk622W9JuJe5WH7UVzKZY= X-Received: by 2002:a6b:b2d2:: with SMTP id b201mr12526867iof.303.1545790984285; Tue, 25 Dec 2018 18:23:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN4Fd1qmDpyHH2kUifSAS2wjP7wQc3YVJ7Ux+5qwk3JxkaqBdiAev3dswZcM0W068jQf6A+LWg== X-Received: by 2002:a6b:b2d2:: with SMTP id b201mr12526856iof.303.1545790984010; Tue, 25 Dec 2018 18:23:04 -0800 (PST) Received: from localhost.localdomain (host-173-230-104-22.mnmigsc.mn.minneapolis.us.clients.pavlovmedia.net. [173.230.104.22]) by smtp.gmail.com with ESMTPSA id c21sm15343229iob.22.2018.12.25.18.23.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Dec 2018 18:23:03 -0800 (PST) From: Kangjie Lu To: kjlu@umn.edu Cc: pakki001@umn.edu, Jingoo Han , Lorenzo Pieralisi , Bjorn Helgaas , Kukjin Kim , Krzysztof Kozlowski , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pci: dwc: add a check for resetting gpio Date: Tue, 25 Dec 2018 20:22:36 -0600 Message-Id: <20181226022236.71682-1-kjlu@umn.edu> X-Mailer: git-send-email 2.17.2 (Apple Git-113) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP devm_gpio_request_one() could fail. The fix checks its status and issues an error if it fails. Signed-off-by: Kangjie Lu --- drivers/pci/controller/dwc/pci-exynos.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c index cee5f2f590e2..e3a045e215d2 100644 --- a/drivers/pci/controller/dwc/pci-exynos.c +++ b/drivers/pci/controller/dwc/pci-exynos.c @@ -226,9 +226,12 @@ static void exynos_pcie_assert_reset(struct exynos_pcie *ep) struct dw_pcie *pci = ep->pci; struct device *dev = pci->dev; - if (ep->reset_gpio >= 0) - devm_gpio_request_one(dev, ep->reset_gpio, - GPIOF_OUT_INIT_HIGH, "RESET"); + if (ep->reset_gpio >= 0) { + if (devm_gpio_request_one(dev, ep->reset_gpio, + GPIOF_OUT_INIT_HIGH, "RESET")) + dev_err(dev, "Failed requesting reset gpio %d\n", + ep->reset_gpio); + } } static int exynos_pcie_establish_link(struct exynos_pcie *ep)