Commit 22ba7289 authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman

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: default avatarOliver O'Halloran <oohall@gmail.com>
Reviewed-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190912052945.12589-1-oohall@gmail.com
parent a4af49f3
...@@ -3090,19 +3090,12 @@ static void pnv_ioda_setup_pe_seg(struct pnv_ioda_pe *pe) ...@@ -3090,19 +3090,12 @@ static void pnv_ioda_setup_pe_seg(struct pnv_ioda_pe *pe)
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
static int pnv_pci_diag_data_set(void *data, u64 val) static int pnv_pci_diag_data_set(void *data, u64 val)
{ {
struct pci_controller *hose; struct pnv_phb *phb = data;
struct pnv_phb *phb;
s64 ret; s64 ret;
if (val != 1ULL) if (val != 1ULL)
return -EINVAL; return -EINVAL;
hose = (struct pci_controller *)data;
if (!hose || !hose->private_data)
return -ENODEV;
phb = hose->private_data;
/* Retrieve the diag data from firmware */ /* Retrieve the diag data from firmware */
ret = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag_data, ret = opal_pci_get_phb_diag_data2(phb->opal_id, phb->diag_data,
phb->diag_data_size); phb->diag_data_size);
...@@ -3141,7 +3134,7 @@ static void pnv_pci_ioda_create_dbgfs(void) ...@@ -3141,7 +3134,7 @@ static void pnv_pci_ioda_create_dbgfs(void)
} }
debugfs_create_file_unsafe("dump_diag_regs", 0200, phb->dbgfs, 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 */ #endif /* CONFIG_DEBUG_FS */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment