]> git.baikalelectronics.ru Git - kernel.git/commit
bcma: fix access to host_pdev for PCIe devices
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 2 Aug 2015 18:26:52 +0000 (20:26 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 10 Aug 2015 19:20:46 +0000 (22:20 +0300)
commit4ce7959ade2d019b9bb5e1fffb1a271312c06b94
treefd6d98807ed921b7e2ccdd7d2257bfc9dc7083f9
parent8dc395d7e2a87c5c0603d4398448135643330659
bcma: fix access to host_pdev for PCIe devices

bus->host_pdev is part of a union so bus->host_pdev != NULL is probably
also true for PCIe devices, because there it accesses bus->host_pci. If
we access the dev member at the offset defined in struct
platform_device in struct pci_dev instead we probably get something
else.

This patch adds a new function which returns the host dev struct and
NULL if we do not have a host dev. When this gets registered on MIPS
brcm47xx we do not have a host dev in some situations.
This function could also be used in other places.

This problem was introduced in this commit:
commit 7f64e609f535c6c3d9477825f51c701d80def18d
Author: Rafa? Mi?ecki <zajec5@gmail.com>
Date:   Sun Jun 28 17:17:13 2015 +0200

    bcma: populate bus DT subnodes as platform_device-s

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/bcma/bcma_private.h
drivers/bcma/main.c