Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp217148ybl; Mon, 12 Aug 2019 14:59:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyG55J2Sqco4DW8AcsPw85YAzAdjfTDt1FHiM1f9K8EUAXk3gVlAYR4jEitWN2x7jVFHf7Z X-Received: by 2002:a17:902:6847:: with SMTP id f7mr34156239pln.311.1565647157571; Mon, 12 Aug 2019 14:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565647157; cv=none; d=google.com; s=arc-20160816; b=AIlsUg1QNXcKZTFB1b3jh6i1Xf4bb+A1bPbTx3fzXiwF0CGtr6OyDhOStx6KuX3Rwx HT5c72WCWDHd9uIvwawKpvG/iX01a0A1O8VXMto4YMYNvfTihDMxrICVN6bn0Ol4obg+ 65JdNRGn9RooGGsidY9fl7VYgRo7EaQHlpKrvp15DQaIOdExIt6P9w6+nne8oU6rjvVp gL1XI+qV4SUQVpuNzooZRYF5omzcmTekafwUNqc9SIWv4TdAWjFUGOw/LAPkf3Oe1JoU EjyLy2j8xQJwhjeUU0nuwVjVN6vWiJ0vnl1a1gSXYH3J8aO6IBILAuyPJXP7eCqaewcU /ELA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xWjdL67521LpwJXHfPB11/eLFyivtRauigDguFFExIw=; b=QLDwrmV+9ky8KvgLqAd89TyC+BXV9YwUas0ECWEMxYAB45PPRFpj818Z8DXl7jDutk BV0UXto9RC3k97w7xRrbVkofOijI4Rhy+/cC+Onjty2JiI1ro8zDED99nkb8nTWanmCR V+iraC1SLSPHAODw+TJa91FK1E4Zepy8Ucw47YCvpHVUH1Y5rANkFig3GQ6f3eZorEJc rswv5u7H9V4tEhLdPpZdk5jbj+MVlbr3YIjZ00tk0eqWMFCWtWp+0adQgHsx8BJXC4dU ItxYnQkYL/cVJrzjT62YiqF2Y4VcgYTeyvYt/VNet/rLzibS+s0SaNLs+5S6aYRBtFnQ /V1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ttcLOwJi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si463514pjv.24.2019.08.12.14.59.02; Mon, 12 Aug 2019 14:59:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ttcLOwJi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727321AbfHLUDd (ORCPT + 99 others); Mon, 12 Aug 2019 16:03:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:33086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727312AbfHLUDd (ORCPT ); Mon, 12 Aug 2019 16:03:33 -0400 Received: from localhost (c-73-15-1-175.hsd1.ca.comcast.net [73.15.1.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25C242075B; Mon, 12 Aug 2019 20:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565640212; bh=txgLwBXJO7Nquw+xRaIsH0AHlPk07h2y7m3am637S9o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ttcLOwJiQ7o3Z1gXS0SSfbnD3lgHSYEQxVWk+BiQFA07c2EYp0mtoPMdq8gGlmGXO e41oBxxivbLPIJm1d/AkU/JrV0vWJSLDfQiqE4wXUXEIunzyj+HJePP4svfpZHvxm9 8ca3mdpFs0xbpgowxST348sUMmFV8N51FU6z5b/w= Date: Mon, 12 Aug 2019 15:03:30 -0500 From: Bjorn Helgaas To: Denis Efremov Cc: Lukas Wunner , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] PCI: pciehp: Replace pciehp_green_led_{on,off,blink}() Message-ID: <20190812200330.GH11785@google.com> References: <20190811195944.23765-1-efremov@linux.com> <20190811195944.23765-5-efremov@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190811195944.23765-5-efremov@linux.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 11, 2019 at 10:59:44PM +0300, Denis Efremov wrote: > This patch replaces pciehp_green_led_{on,off,blink}() with > pciehp_set_indicators(). > > Reviewed-by: Lukas Wunner > Signed-off-by: Denis Efremov > --- > drivers/pci/hotplug/pciehp.h | 12 ++++++++--- > drivers/pci/hotplug/pciehp_hpc.c | 36 -------------------------------- > 2 files changed, 9 insertions(+), 39 deletions(-) > > diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h > index 9a2a2d0db9d2..6cdcb1ca561f 100644 > --- a/drivers/pci/hotplug/pciehp.h > +++ b/drivers/pci/hotplug/pciehp.h > @@ -183,9 +183,6 @@ void pciehp_set_indicators(struct controller *ctrl, > enum pciehp_indicator 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); > @@ -202,6 +199,15 @@ int pciehp_get_raw_indicator_status(struct hotplug_slot *h_slot, u8 *status); > #define pciehp_set_attention_status(ctrl, status) \ > pciehp_set_indicators(ctrl, PWR_NONE, (status == 0 ? ATTN_OFF : status)) > > +#define pciehp_green_led_on(ctrl) \ > + pciehp_set_indicators(ctrl, PWR_ON, ATTN_NONE) > + > +#define pciehp_green_led_off(ctrl) \ > + pciehp_set_indicators(ctrl, PWR_OFF, ATTN_NONE) > + > +#define pciehp_green_led_blink(ctrl) \ > + pciehp_set_indicators(ctrl, PWR_BLINK, ATTN_NONE) You must have a reason, but why didn't you completely remove pciehp_green_led_on(), etc, and change the callers to use pciehp_set_indicators() instead? > static inline const char *slot_name(struct controller *ctrl) > { > return hotplug_slot_name(&ctrl->hotplug_slot); > diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c > index fb4bea16063a..8362d24405fd 100644 > --- a/drivers/pci/hotplug/pciehp_hpc.c > +++ b/drivers/pci/hotplug/pciehp_hpc.c > @@ -456,42 +456,6 @@ void pciehp_set_indicators(struct controller *ctrl, > cmd); > } > > -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 >