iommu/amd: Update struct iommu_dev_data definition
authorVasant Hegde <vasant.hegde@amd.com>
Wed, 6 Jul 2022 11:37:51 +0000 (17:07 +0530)
committerJoerg Roedel <jroedel@suse.de>
Thu, 7 Jul 2022 07:37:32 +0000 (09:37 +0200)
commitd02674d71c5a625e5b2e4323edbf05ebedaf4273
tree576e59050b2d1a31eeafdd4fded978199d8efac7
parent83874d51eb4a51725c9403e11476a433add98c34
iommu/amd: Update struct iommu_dev_data definition

struct iommu_dev_data contains member "pdev" to point to pci_dev. This is
valid for only PCI devices and for other devices this will be NULL. This
causes unnecessary "pdev != NULL" check at various places.

Replace "struct pci_dev" member with "struct device" and use to_pci_dev()
to get pci device reference as needed. Also adjust setup_aliases() and
clone_aliases() function.

No functional change intended.

Co-developed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20220706113825.25582-2-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/iommu.c