From: Andrew Donnellan Date: Wed, 13 Jul 2016 21:17:13 +0000 (+1000) Subject: PCI/hotplug: pnv_php: handle OPAL_PCI_SLOT_OFFLINE power state X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5473a6bf635d35d5c1d12d0e132b51a861a5c973;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git PCI/hotplug: pnv_php: handle OPAL_PCI_SLOT_OFFLINE power state When calling pnv_php_set_slot_power_state() with state == OPAL_PCI_SLOT_OFFLINE, remove devices from the device tree as if we're dealing with OPAL_PCI_SLOT_POWER_OFF. Cc: Gavin Shan Cc: linux-pci@vger.kernel.org Cc: Bjorn Helgaas Signed-off-by: Andrew Donnellan Signed-off-by: Ian Munsie Acked-by: Gavin Shan Signed-off-by: Michael Ellerman --- diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 2d2f704e1e97..e6245b03f0a1 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -317,7 +317,7 @@ int pnv_php_set_slot_power_state(struct hotplug_slot *slot, return ret; } - if (state == OPAL_PCI_SLOT_POWER_OFF) + if (state == OPAL_PCI_SLOT_POWER_OFF || state == OPAL_PCI_SLOT_OFFLINE) pnv_php_rmv_devtree(php_slot); else ret = pnv_php_add_devtree(php_slot);