From patchwork Tue Nov 19 22:58:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3204351 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4940AC045B for ; Tue, 19 Nov 2013 22:58:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7BD6920621 for ; Tue, 19 Nov 2013 22:58:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FC1920617 for ; Tue, 19 Nov 2013 22:58:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166Ab3KSW6M (ORCPT ); Tue, 19 Nov 2013 17:58:12 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:62277 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752152Ab3KSW6K (ORCPT ); Tue, 19 Nov 2013 17:58:10 -0500 Received: by mail-pa0-f50.google.com with SMTP id kp14so7378235pab.23 for ; Tue, 19 Nov 2013 14:58:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=Fy+3pyQhJF7HgOA21IJimlBTJb6o3loE6/YYn8D03sI=; b=ulger1EqgOmjZe5ZPD5cwW5PsROt6tAboRi3SRT53VLG7b1np/kHZBwn3vsMtzG/dP nmcLbOZCow9KkzCmC/Rx/mo2TbGg7fz9WoUQN3fTrdPDuzfLSoOQUeQJ38kaWi9DwUVi K9GonQ3J/gOvNE0Z71XD+lNfgySye40g7TweL2lb0/DLGxywyy3YK9+neqiReSZ4z6vs WE+tjKsnRHBTOJI2ZgBuv+9OfXpJYXAV6tuNfyJ3bN2hRcLmEDS/7Hz0hh1LhiYaWZg1 LasHgAAToaWXG4lk9mewk1RN4fhjCjdOWZPzhJDmCnM2NCHhOBWo1Uy9F4eKcWj1rznM /vug== X-Received: by 10.68.110.196 with SMTP id ic4mr20584972pbb.84.1384901890169; Tue, 19 Nov 2013 14:58:10 -0800 (PST) Received: from [192.168.211.134] ([66.129.239.13]) by mx.google.com with ESMTPSA id qv8sm32985063pbc.31.2013.11.19.14.58.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Nov 2013 14:58:09 -0800 (PST) Message-ID: <528BECFF.7000900@gmail.com> Date: Tue, 19 Nov 2013 14:58:07 -0800 From: Rajat Jain User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 MIME-Version: 1.0 To: Linux-PCI , Linux-hotplug , linux-kernel@vger.kernel.org CC: Bjorn Helgaas , Guenter Roeck , Kenji Kaneshige , Alex Williamson , Yijing Wang , Paul Bolle , "Eric W. Biederman" , Rajat Jain , Rajat Jain , Guenter Roeck Subject: [RFC PATCH 1/4] pciehp: Make check_link_active() non-static Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP check_link_active() functionality needs to be used by subsequent patches (that introduce link state change based hotplug). Thus make the function non-static, and rename it to pciehp_check_link_active() so as to be consistent with other non-static functions. Signed-off-by: Rajat Jain --- drivers/pci/hotplug/pciehp.h | 1 + drivers/pci/hotplug/pciehp_hpc.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 541bbe6..fc322ed 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -154,6 +154,7 @@ void pciehp_green_led_on(struct slot *slot); void pciehp_green_led_off(struct slot *slot); void pciehp_green_led_blink(struct slot *slot); int pciehp_check_link_status(struct controller *ctrl); +bool pciehp_check_link_active(struct controller *ctrl); void pciehp_release_ctrl(struct controller *ctrl); int pciehp_reset_slot(struct slot *slot, int probe); diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 51f56ef..3a5eee7 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -241,7 +241,7 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) return retval; } -static bool check_link_active(struct controller *ctrl) +bool pciehp_check_link_active(struct controller *ctrl) { bool ret = false; u16 lnk_status; @@ -261,12 +261,12 @@ static void __pcie_wait_link_active(struct controller *ctrl, bool active) { int timeout = 1000; - if (check_link_active(ctrl) == active) + if (pciehp_check_link_active(ctrl) == active) return; while (timeout > 0) { msleep(10); timeout -= 10; - if (check_link_active(ctrl) == active) + if (pciehp_check_link_active(ctrl) == active) return; } ctrl_dbg(ctrl, "Data Link Layer Link Active not %s in 1000 msec\n",