]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
PCI: rockchip: Add remove() support
authorBrian Norris <briannorris@chromium.org>
Fri, 10 Mar 2017 02:46:15 +0000 (18:46 -0800)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 21 Apr 2017 15:54:35 +0000 (10:54 -0500)
commit073d3dbe9a7c38888d8dafe09df421b174a6cffa
treea5d31cfbe63c905a5954096b887e70f631a9a2f7
parent64d6ea602ce619633a6e0af979e2c73738f6aeba
PCI: rockchip: Add remove() support

Currently, if we try to unbind the platform device, the remove will
succeed, but the removal won't undo most of the registration, leaving
partially-configured PCI devices in the system.

This allows, for example, a simple 'lspci' to crash the system, as it will
try to touch the freed (via devm_*) driver structures, e.g., on RK3399:

  # echo f8000000.pcie > /sys/bus/platform/drivers/rockchip-pcie/unbind
  # lspci

So let's implement device remove().

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/pci/host/pcie-rockchip.c