diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-09-12 15:29:43 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-01-23 21:31:20 +1100 |
commit | 22ba7289079be12c85895fee41602139e9553c93 (patch) | |
tree | de9b40a645f550d60bda93d23993af270931f8d3 /arch/powerpc/platforms | |
parent | a4af49f34f76f1e6125b22b50d18580426d935e0 (diff) |
powernv/pci: Use pnv_phb as the private data for debugfs entries
Use the pnv_phb structure as the private data pointer for the debugfs
files. This lets us delete some code and an open-coded use of
hose->private_data.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190912052945.12589-1-oohall@gmail.com
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index d178c572c474..f2c755626887 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -3090,19 +3090,12 @@ static void pnv_ioda_setup_pe_seg(struct pnv_ioda_pe *pe) #ifdef CONFIG_DEBUG_FS static int pnv_pci_diag_data_set(void *data, u64 val) { - struct pci_controller *hose; - struct pnv_phb *phb; + struct pnv_phb *phb = data; s64 ret; if (val != 1ULL) return -EINVAL; - hose = (struct pci_controller *)data; - if (!hose || !hose->private_data) - return -ENODEV; - - phb = hose->private_data; - /* Retrieve the diag data from firmware */ ret = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag_data, phb->diag_data_size); @@ -3141,7 +3134,7 @@ static void pnv_pci_ioda_create_dbgfs(void) } debugfs_create_file_unsafe("dump_diag_regs", 0200, phb->dbgfs, - hose, &pnv_pci_diag_data_fops); + phb, &pnv_pci_diag_data_fops); } #endif /* CONFIG_DEBUG_FS */ } |