summaryrefslogtreecommitdiffstats
path: root/arch/sparc/prom/misc_64.c
diff options
context:
space:
mode:
authorSowmini Varadhan <sowmini.varadhan@oracle.com>2016-04-11 17:57:05 -0700
committerDavid S. Miller <davem@davemloft.net>2016-04-21 16:43:45 -0400
commit9a78d4fc28904785ffe4c2d361e25b251b479704 (patch)
tree9f213cfb1f2778762d4a55669db75f30e2555617 /arch/sparc/prom/misc_64.c
parenta95f94bc98754bad32cb7f36c867d71f3f2be729 (diff)
downloadblackbird-obmc-linux-9a78d4fc28904785ffe4c2d361e25b251b479704.tar.gz
blackbird-obmc-linux-9a78d4fc28904785ffe4c2d361e25b251b479704.zip
sparc/pci: Refactor dev_archdata initialization into pci_init_dev_archdata
The function pcibios_add_device() added by commit d0c31e020057 ("sparc/PCI: Fix for panic while enabling SR-IOV") initializes the dev_archdata by doing a memcpy from the PF. This has the problem that it erroneously copies the OF device without explicitly refcounting it. As David Miller pointed out: "Generally speaking we don't really support hot-plug for OF probed devices, but if we did all of the device tree pointers have to be refcounted properly." To fix this error, and also avoid code duplication, this patch creates a new helper function, pci_init_dev_archdata(), that initializes the fields in dev_archdata, and can be invoked by callers after they have taken the needed refcounts Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Tested-by: Babu Moger <babu.moger@oracle.com> Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/prom/misc_64.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud