From patchwork Tue Dec 3 22:32:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 3279111 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A77F69F377 for ; Tue, 3 Dec 2013 22:32:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CA092047C for ; Tue, 3 Dec 2013 22:32:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AAAB020462 for ; Tue, 3 Dec 2013 22:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755402Ab3LCWcS (ORCPT ); Tue, 3 Dec 2013 17:32:18 -0500 Received: from mail-pd0-f173.google.com ([209.85.192.173]:42384 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755396Ab3LCWcR (ORCPT ); Tue, 3 Dec 2013 17:32:17 -0500 Received: by mail-pd0-f173.google.com with SMTP id p10so21053661pdj.32 for ; Tue, 03 Dec 2013 14:32:17 -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=fLOiXguXIjJF8oJlK5xWpY0CMByFEmrvq4qMxhasPWM=; b=hXDGMQxbqct8Ndub/lveUAJPC0iLr4S9dtPF4XoS6bLZsZLf2Mn/88NneIbckUhDp/ rlEbuaIIyjcUPOVkUOtxJrAylQz1SR3xdFaqJra8rwAonyVi0OZwuOoe41txp/wa/vKu JgVYtgfw7OHRW+OtHEhn52zJIFxP0H6VXdeShp/xOCPVdBjY9I0GM3wUHQFWKs9sckY8 EzgPfLjKStWCrmdNI6iZQCBkm3rn3/tq06UolA7KFxY5+9EEA7Gm5zXE7tag3r41m1wL oSGluteXnL/7gKfHlPeOo+HDL1E1nC2+Q8m45C5kjiiDSM6yxO8EMmut0YwGXuNxsAjG /BnA== X-Received: by 10.68.172.196 with SMTP id be4mr41559140pbc.12.1386109937318; Tue, 03 Dec 2013 14:32:17 -0800 (PST) Received: from [192.168.211.135] ([66.129.239.12]) by mx.google.com with ESMTPSA id z10sm24172022pas.6.2013.12.03.14.32.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 14:32:15 -0800 (PST) Message-ID: <529E5BEA.5040208@gmail.com> Date: Tue, 03 Dec 2013 14:32:10 -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@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Kenji Kaneshige , Alex Williamson , Yijing Wang , Paul Bolle CC: Rajat Jain , Rajat Jain , Rajat Jain , Guenter Roeck , Guenter Roeck Subject: [PATCH v2 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=-6.8 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=unavailable 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 Signed-off-by: Guenter Roeck --- v2: Same as v1, dropped the "RFC" from subject, and added Guenter's signature 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",