Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2906629ybl; Mon, 19 Aug 2019 09:09:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrIGGJzdrvavg246isHW9315J/JbkKD1gYv0i3o+nxBduHBZHWGwoFu4AbLDrpfRO2Lej+ X-Received: by 2002:a17:90a:bf91:: with SMTP id d17mr14596552pjs.111.1566230972036; Mon, 19 Aug 2019 09:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566230972; cv=none; d=google.com; s=arc-20160816; b=PaNKtf9ZAvuwLuE7aQxquIrRDUMW2k8vkKxH9aY9udN111e3w9gWily9OA2lMH2T9u bDEH6lOSpf1++S8W4gxB0ibePWEqzDdvxzzFp23IG9CtBrIAqCMRsdz8LfqKr1s2MPfP kff5CvXTUHXmF17hDJrLF8oVHqEDk17DX7ip4r1MWZ9d4acHISTjSG61HKrexPfxjQSG mUQRByR8dPPkhPQEtrLwKqFtLn3LQIalKjq/y6IJkz7Kr672j8c1K9yG51sj844i5bUs IDrsmRzpyChSOIqX7rxUNVytee6M81cZ9CjtOot8iAka5HgK9bHS+m3w+GVus7W5rie+ wYdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=J6GaCUg1JsCqoVd2udtQCNNU0NqEG0Fb+1qaGVREJyo=; b=xnsYvZ/yYmxzQTeGsRAFx27fTFIz6Bl1zQGuqLRaN+rGolTBocfjzlmjPqCWVma0w2 4F7bZ+3EFrMKDC3UpBTfW2wyMuvT3iR/6oWRNNccPh/vL1TGB9ILF79DDYRYbJ+oza9O x0L0UaVe+KxUBMcQ47SgwgkDQNzcqglXfVC8bha0w4YO0OBIrXGBWvIui+6GmPl6IxyT USG3nYHpEoePLRLngL75u98bUw+EpcaljdxuGUFPryzRYLQVUcDRq3ZeB25jvvVGIblQ uJ/KT92jc7hnnXbV7QkGY7pPRjnJUSxDUBiw7gJQCxKU14F3wfAAbc4m64OT8UOIV2f/ p2Kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si10167798pgr.89.2019.08.19.09.09.16; Mon, 19 Aug 2019 09:09:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727898AbfHSQHf (ORCPT + 99 others); Mon, 19 Aug 2019 12:07:35 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43394 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727865AbfHSQH3 (ORCPT ); Mon, 19 Aug 2019 12:07:29 -0400 Received: by mail-wr1-f65.google.com with SMTP id y8so9283962wrn.10; Mon, 19 Aug 2019 09:07:28 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=J6GaCUg1JsCqoVd2udtQCNNU0NqEG0Fb+1qaGVREJyo=; b=LRCU/hIqszhr6EsL6Urrdq95c1haUOd4X8p+Xnry9Fjn3xVnHKvp4uQiZ6hRGjHO2L Uzgq08TzjwmEFCozs5IFFD0mzipQYZZHDVLYIKSU7NC6HGXW8LZv6Et4RMAi4BsXk3MH CiawXsYuKo19Nl0RmWQZsh73s3Z2g/cvPmGkuBD4UzXcgPlKeDIZXbp3Wp75sOdRqyjz YTqSh9gslENP1ituEhufEl07GFFhAAPmSR8zbO8E/TbsbkEgVSCsgNMVMRerdzpCBxOL mQQSykhsNJKC3CqpKBz5yvb97Qv8FGpbfuc6wYIhp+EIOxmRgZY3u6+/UqzMIONS5QBB g1SQ== X-Gm-Message-State: APjAAAVPJjBrVLPFN1BBHLzzk0gdXYQwDL21e8PJxjuDz6J/vZp9qau2 v4DQ9OOypL+1PQdYQMg53OU= X-Received: by 2002:adf:ce8d:: with SMTP id r13mr20854901wrn.37.1566230847978; Mon, 19 Aug 2019 09:07:27 -0700 (PDT) Received: from green.intra.ispras.ru (bran.ispras.ru. [83.149.199.196]) by smtp.googlemail.com with ESMTPSA id b136sm32442189wme.18.2019.08.19.09.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 09:07:27 -0700 (PDT) From: Denis Efremov To: Bjorn Helgaas Cc: Denis Efremov , Lukas Wunner , sathyanarayanan kuppuswamy , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/4] PCI: pciehp: Remove pciehp_green_led_{on,off,blink}() Date: Mon, 19 Aug 2019 19:06:43 +0300 Message-Id: <20190819160643.27998-5-efremov@linux.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190819160643.27998-1-efremov@linux.com> References: <20190819160643.27998-1-efremov@linux.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove pciehp_green_led_{on,off,blink}() and use pciehp_set_indicators() instead, since the code is mostly the same. Signed-off-by: Denis Efremov --- drivers/pci/hotplug/pciehp.h | 3 --- drivers/pci/hotplug/pciehp_ctrl.c | 12 ++++++++--- drivers/pci/hotplug/pciehp_hpc.c | 36 ------------------------------- 3 files changed, 9 insertions(+), 42 deletions(-) diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index acda513f37d7..da429345cf70 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h @@ -170,9 +170,6 @@ void pciehp_get_power_status(struct controller *ctrl, u8 *status); void pciehp_set_indicators(struct controller *ctrl, int pwr, int attn); void pciehp_get_latch_status(struct controller *ctrl, u8 *status); int pciehp_query_power_fault(struct controller *ctrl); -void pciehp_green_led_on(struct controller *ctrl); -void pciehp_green_led_off(struct controller *ctrl); -void pciehp_green_led_blink(struct controller *ctrl); bool pciehp_card_present(struct controller *ctrl); bool pciehp_card_present_or_link_active(struct controller *ctrl); int pciehp_check_link_status(struct controller *ctrl); diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 232f7bfcfce9..862fe86e87cc 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -65,7 +65,9 @@ static int board_added(struct controller *ctrl) return retval; } - pciehp_green_led_blink(ctrl); + pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_BLINK, + PCI_EXP_SLTCTL_ATTN_IND_NONE); + /* Check link training status */ retval = pciehp_check_link_status(ctrl); @@ -124,7 +126,9 @@ static void remove_board(struct controller *ctrl, bool safe_removal) } /* turn off Green LED */ - pciehp_green_led_off(ctrl); + pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF, + PCI_EXP_SLTCTL_ATTN_IND_NONE); + } static int pciehp_enable_slot(struct controller *ctrl); @@ -311,7 +315,9 @@ static int pciehp_enable_slot(struct controller *ctrl) pm_runtime_get_sync(&ctrl->pcie->port->dev); ret = __pciehp_enable_slot(ctrl); if (ret && ATTN_BUTTN(ctrl)) - pciehp_green_led_off(ctrl); /* may be blinking */ + /* may be blinking */ + pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF, + PCI_EXP_SLTCTL_ATTN_IND_NONE); pm_runtime_put(&ctrl->pcie->port->dev); mutex_lock(&ctrl->state_lock); diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 8f894fd5cd27..9dc1ecd703b9 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -447,42 +447,6 @@ void pciehp_set_indicators(struct controller *ctrl, int pwr, int attn) } } -void pciehp_green_led_on(struct controller *ctrl) -{ - if (!PWR_LED(ctrl)) - return; - - pcie_write_cmd_nowait(ctrl, PCI_EXP_SLTCTL_PWR_IND_ON, - PCI_EXP_SLTCTL_PIC); - ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, - pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, - PCI_EXP_SLTCTL_PWR_IND_ON); -} - -void pciehp_green_led_off(struct controller *ctrl) -{ - if (!PWR_LED(ctrl)) - return; - - pcie_write_cmd_nowait(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF, - PCI_EXP_SLTCTL_PIC); - ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, - pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, - PCI_EXP_SLTCTL_PWR_IND_OFF); -} - -void pciehp_green_led_blink(struct controller *ctrl) -{ - if (!PWR_LED(ctrl)) - return; - - pcie_write_cmd_nowait(ctrl, PCI_EXP_SLTCTL_PWR_IND_BLINK, - PCI_EXP_SLTCTL_PIC); - ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, - pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, - PCI_EXP_SLTCTL_PWR_IND_BLINK); -} - int pciehp_power_on_slot(struct controller *ctrl) { struct pci_dev *pdev = ctrl_dev(ctrl); -- 2.21.0