PCI: Add and use pci_<level>: dev_<level> equivalents
Subsystems (4)
cover PCI: Add and use pci_<level>: dev_<level> equivalents
Replace current uses of dev_<level> with pci_<level> by adding and using PCI specific fuctions.
Frederick Lawler (2):
PCI: Create minor pci_dev log wrapper functions
PCI: Replace calls from dev_<level> to pci_<level>
drivers/pci/access.c | 6 +- drivers/pci/bus.c | 4 +- drivers/pci/iov.c | 10 +-- drivers/pci/irq.c | 6 +- drivers/pci/msi.c | 6 +- drivers/pci/pci-acpi.c | 2 +- drivers/pci/pci-stub.c | 2 +- drivers/pci/pci-sysfs.c | 10 +-- drivers/pci/pci.c | 76 ++++++++--------- drivers/pci/probe.c | 74 ++++++++--------- drivers/pci/quirks.c | 198 ++++++++++++++++++++++----------------------- drivers/pci/rom.c | 4 +- drivers/pci/setup-bus.c | 44 +++++----- drivers/pci/setup-irq.c | 4 +- drivers/pci/setup-res.c | 38 ++++----- drivers/pci/vc.c | 16 ++-- drivers/pci/xen-pcifront.c | 16 ++-- include/linux/pci.h | 91 +++++++++++++++++++++ 18 files changed, 349 insertions(+), 258 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 PCI: Create minor pci_dev log wrapper functions
Create minor pci_dev log wrapper functions
--- include/linux/pci.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+)
include/linux/pci.h +91 -0
@@ -2278,4 +2278,95 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev)/* provide the legacy pci_dma_* API */ #include <linux/pci-dma-compat.h> +static inline void pci_printk (const char *level, +const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_printk (level, &(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_emerg (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_emerg (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_crit (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_crit (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_alert (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_alert (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_err (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_err (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_notice (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_notice (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_warn (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_warn (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_info (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_info (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} + +static inline void pci_dbg (const struct pci_dev *pdev, +const char *fmt, ...) +{ +va_list argptr; + +va_start (argptr, fmt); +dev_dbg (&(pdev)->dev, fmt, argptr); +va_end (argptr); +} +#endif /* LINUX_PCI_H */
Signature · 1 line
2.7.4
PATCH 2/2 PCI: Replace calls from dev_<level> to pci_<level>
In reply to Frederick LawlerReplace calls from dev_<level> to pci_<level>
--- drivers/pci/access.c | 6 +- drivers/pci/bus.c | 4 +- drivers/pci/iov.c | 10 +-- drivers/pci/irq.c | 6 +- drivers/pci/msi.c | 6 +- drivers/pci/pci-acpi.c | 2 +- drivers/pci/pci-stub.c | 2 +- drivers/pci/pci-sysfs.c | 10 +-- drivers/pci/pci.c | 76 ++++++++--------- drivers/pci/probe.c | 74 ++++++++--------- drivers/pci/quirks.c | 198 ++++++++++++++++++++++----------------------- drivers/pci/rom.c | 4 +- drivers/pci/setup-bus.c | 44 +++++----- drivers/pci/setup-irq.c | 4 +- drivers/pci/setup-res.c | 38 ++++----- drivers/pci/vc.c | 16 ++-- drivers/pci/xen-pcifront.c | 16 ++-- 17 files changed, 258 insertions(+), 258 deletions(-)
drivers/pci/access.c +3 -3
@@ -333,7 +333,7 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size) (tag == PCI_VPD_LTIN_RW_DATA)) {if (pci_read_vpd (dev, off+1 ,2 , &header[1 ]) !=2 ) { -dev_warn (&dev->dev, +pci_warn (dev,"invalid large VPD tag %02x size at offset %zu" , tag, off +1 );return 0 ;
@@ -354,7 +354,7 @@ static size_t pci_vpd_size(struct pci_dev *dev, size_t old_size)if ((tag !=PCI_VPD_LTIN_ID_STRING ) && (tag !=PCI_VPD_LTIN_RO_DATA ) && (tag !=PCI_VPD_LTIN_RW_DATA )) { -dev_warn (&dev->dev, +pci_warn (dev,"invalid %s VPD tag %02x at offset %zu" , (header[0 ] &PCI_VPD_LRDT ) ?"large" :"short" , tag, off);
@@ -402,7 +402,7 @@ static int pci_vpd_wait(struct pci_dev *dev) max_sleep *=2 ; } -dev_warn (&dev->dev,"VPD access failed. This is likely a firmware bug on this device. Contact the card vendor for a firmware update\n" ); +pci_warn (dev,"VPD access failed. This is likely a firmware bug on this device. Contact the card vendor for a firmware update\n" );return -ETIMEDOUT ; }
drivers/pci/bus.c +2 -2
@@ -289,7 +289,7 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx) res->end = end; res->flags &= ~IORESOURCE_UNSET ; orig_res.flags &= ~IORESOURCE_UNSET ; -dev_printk (KERN_DEBUG , &dev->dev,"%pR clipped to %pR\n" , +pci_printk (KERN_DEBUG , dev,"%pR clipped to %pR\n" , &orig_res, res);return true;
@@ -325,7 +325,7 @@ void pci_bus_add_device(struct pci_dev *dev) dev->match_driver = true; retval =device_attach (&dev->dev);if (retval <0 && retval != -EPROBE_DEFER ) { -dev_warn (&dev->dev,"device attach failed (%d)\n" , retval); +pci_warn (dev,"device attach failed (%d)\n" , retval);pci_proc_detach_device (dev);pci_remove_sysfs_dev_files (dev);return ;
drivers/pci/iov.c +5 -5
@@ -259,19 +259,19 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) nres++; }if (nres != iov->nres) { -dev_err (&dev->dev,"not enough MMIO resources for SR-IOV\n" ); +pci_err (dev,"not enough MMIO resources for SR-IOV\n" );return -ENOMEM ; } bus =pci_iov_virtfn_bus (dev, nr_virtfn -1 );if (bus > dev->bus->busn_res.end) { -dev_err (&dev->dev,"can't enable %d VFs (bus %02x out of range of %pR)\n" , +pci_err (dev,"can't enable %d VFs (bus %02x out of range of %pR)\n" , nr_virtfn, bus, &dev->bus->busn_res);return -ENOMEM ; }if (pci_enable_resources (dev, bars)) { -dev_err (&dev->dev,"SR-IOV: IOV BARS not allocated\n" ); +pci_err (dev,"SR-IOV: IOV BARS not allocated\n" );return -ENOMEM ; }
@@ -298,7 +298,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) rc =pcibios_sriov_enable (dev, initial);if (rc) { -dev_err (&dev->dev,"failure %d from pcibios_sriov_enable()\n" , rc); +pci_err (dev,"failure %d from pcibios_sriov_enable()\n" , rc); goto err_pcibios; }
@@ -432,7 +432,7 @@ static int sriov_init(struct pci_dev *dev, int pos) } iov->barsz[i] =resource_size (res); res->end = res->start +resource_size (res) * total -1 ; -dev_info (&dev->dev,"VF(n) BAR%d space: %pR (contains BAR%d for %d VFs)\n" , +pci_info (dev,"VF(n) BAR%d space: %pR (contains BAR%d for %d VFs)\n" , i, res, i, total); i += bar64; nres++;
drivers/pci/irq.c +3 -3
@@ -16,11 +16,11 @@ static void pci_note_irq_problem(struct pci_dev *pdev, const char *reason) {struct pci_dev *parent =to_pci_dev (pdev->dev.parent); -dev_err (&pdev->dev, +pci_err (pdev,"Potentially misrouted IRQ (Bridge %s %04x:%04x)\n" ,dev_name (&parent->dev), parent->vendor, parent->device); -dev_err (&pdev->dev,"%s\n" , reason); -dev_err (&pdev->dev,"Please report to [email protected]\n" ); +pci_err (pdev,"%s\n" , reason); +pci_err (pdev,"Please report to [email protected]\n" );WARN_ON (1 ); }
drivers/pci/msi.c +3 -3
@@ -578,7 +578,7 @@ static int msi_verify_entries(struct pci_dev *dev)for_each_pci_msi_entry (entry, dev) {if (!dev->no_64bit_msi || !entry->msg.address_hi)continue ; -dev_err (&dev->dev,"Device has broken 64-bit MSI but arch" +pci_err (dev,"Device has broken 64-bit MSI but arch" " tried to assign one above 4G\n" );return -EIO ; }
@@ -962,7 +962,7 @@ static int __pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries,/* Check whether driver already requested for MSI irq */ if (dev->msi_enabled) { -dev_info (&dev->dev,"can't enable MSI-X (MSI IRQ already assigned)\n" ); +pci_info (dev,"can't enable MSI-X (MSI IRQ already assigned)\n" );return -EINVAL ; }return msix_capability_init (dev, entries, nvec, affd);
@@ -1032,7 +1032,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,/* Check whether driver already requested MSI-X irqs */ if (dev->msix_enabled) { -dev_info (&dev->dev, +pci_info (dev,"can't enable MSI (MSI-X already enabled)\n" );return -EINVAL ; }
drivers/pci/pci-acpi.c +1 -1
@@ -542,7 +542,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) }if (!error) -dev_dbg (&dev->dev,"power state changed by ACPI to %s\n" , +pci_dbg (dev,"power state changed by ACPI to %s\n" ,acpi_power_state_string (state_conv[state]));return error;
drivers/pci/pci-stub.c +1 -1
@@ -28,7 +28,7 @@ MODULE_PARM_DESC(ids, "Initial PCI IDs to add to the stub driver, format is "static int pci_stub_probe (struct pci_dev *dev,const struct pci_device_id *id) { -dev_info (&dev->dev,"claimed by stub\n" ); +pci_info (dev,"claimed by stub\n" );return 0 ; }
drivers/pci/pci-sysfs.c +5 -5
@@ -348,7 +348,7 @@ static ssize_t numa_node_store(struct device *dev,return -EINVAL ;add_taint (TAINT_FIRMWARE_WORKAROUND ,LOCKDEP_STILL_OK ); -dev_alert (&pdev->dev,FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates." , +pci_alert (pdev,FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates." , node); dev->numa_node = node;
@@ -411,7 +411,7 @@ static ssize_t msi_bus_store(struct device *dev, struct device_attribute *attr,*/ if (!subordinate) { pdev->no_msi = !val; -dev_info (&pdev->dev,"MSI/MSI-X %s for future drivers\n" , +pci_info (pdev,"MSI/MSI-X %s for future drivers\n" , val ?"allowed" :"disallowed" );return count; }
@@ -613,7 +613,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,/* is PF driver loaded w/callback */ if (!pdev->driver || !pdev->driver->sriov_configure) { -dev_info (&pdev->dev,"Driver doesn't support SRIOV configuration via sysfs\n" ); +pci_info (pdev,"Driver doesn't support SRIOV configuration via sysfs\n" ); ret = -ENOENT ; goto exit; }
@@ -626,7 +626,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,/* enable VFs */ if (pdev->sriov->num_VFs) { -dev_warn (&pdev->dev,"%d VFs already enabled. Disable before enabling %d VFs\n" , +pci_warn (pdev,"%d VFs already enabled. Disable before enabling %d VFs\n" , pdev->sriov->num_VFs, num_vfs); ret = -EBUSY ; goto exit;
@@ -637,7 +637,7 @@ static ssize_t sriov_numvfs_store(struct device *dev, goto exit;if (ret != num_vfs) -dev_warn (&pdev->dev,"%d VFs requested; only %d enabled\n" , +pci_warn (pdev,"%d VFs requested; only %d enabled\n" , num_vfs, ret); exit:
drivers/pci/pci.c +38 -38
282 lines not on this page · raw message
drivers/pci/probe.c +37 -37
287 lines not on this page · raw message
drivers/pci/quirks.c +99 -99
758 lines not on this page · raw message
drivers/pci/rom.c +2 -2
@@ -92,14 +92,14 @@ size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size)void __iomem *pds;/* Standard PCI ROMs start out with these bytes 55 AA */ if (readw (image) !=0xAA55 ) { -dev_err (&pdev->dev,"Invalid PCI ROM header signature: expecting 0xaa55, got %#06x\n" , +pci_err (pdev,"Invalid PCI ROM header signature: expecting 0xaa55, got %#06x\n" ,readw (image));break ; }/* get the PCI data structure and check its "PCIR" signature */ pds = image +readw (image +24 );if (readl (pds) !=0x52494350 ) { -dev_err (&pdev->dev,"Invalid PCI ROM data signature: expecting 0x52494350, got %#010x\n" , +pci_err (pdev,"Invalid PCI ROM data signature: expecting 0x52494350, got %#010x\n" ,readl (pds));break ; }
drivers/pci/setup-bus.c +22 -22
176 lines not on this page · raw message
drivers/pci/setup-irq.c +2 -2
@@ -25,7 +25,7 @@ void pci_assign_irq(struct pci_dev *dev)struct pci_host_bridge *hbrg =pci_find_host_bridge (dev->bus);if (!(hbrg->map_irq)) { -dev_dbg (&dev->dev,"runtime IRQ mapping not provided by arch\n" ); +pci_dbg (dev,"runtime IRQ mapping not provided by arch\n" );return ; }
@@ -55,7 +55,7 @@ void pci_assign_irq(struct pci_dev *dev) } dev->irq = irq; -dev_dbg (&dev->dev,"assign IRQ: got %d\n" , dev->irq); +pci_dbg (dev,"assign IRQ: got %d\n" , dev->irq);/* Always tell the device, so the driver knows what is the real IRQ to use; the device does not use it. */
drivers/pci/setup-res.c +19 -19
@@ -103,7 +103,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)pci_read_config_dword (dev, reg, &check);if ((new ^ check) & mask) { -dev_err (&dev->dev,"BAR %d: error updating (%#08x != %#08x)\n" , +pci_err (dev,"BAR %d: error updating (%#08x != %#08x)\n" , resno, new, check); }
@@ -112,7 +112,7 @@ static void pci_std_update_resource(struct pci_dev *dev, int resno)pci_write_config_dword (dev, reg +4 , new);pci_read_config_dword (dev, reg +4 , &check);if (check != new) { -dev_err (&dev->dev,"BAR %d: error updating (high %#08x != %#08x)\n" , +pci_err (dev,"BAR %d: error updating (high %#08x != %#08x)\n" , resno, new, check); } }
@@ -137,7 +137,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource)struct resource *root, *conflict;if (res->flags &IORESOURCE_UNSET ) { -dev_info (&dev->dev,"can't claim BAR %d %pR: no address assigned\n" , +pci_info (dev,"can't claim BAR %d %pR: no address assigned\n" , resource, res);return -EINVAL ; }
@@ -152,7 +152,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) root =pci_find_parent_resource (dev, res);if (!root) { -dev_info (&dev->dev,"can't claim BAR %d %pR: no compatible bridge window\n" , +pci_info (dev,"can't claim BAR %d %pR: no compatible bridge window\n" , resource, res); res->flags |=IORESOURCE_UNSET ;return -EINVAL ;
@@ -160,7 +160,7 @@ int pci_claim_resource(struct pci_dev *dev, int resource) conflict =request_resource_conflict (root, res);if (conflict) { -dev_info (&dev->dev,"can't claim BAR %d %pR: address conflict with %s %pR\n" , +pci_info (dev,"can't claim BAR %d %pR: address conflict with %s %pR\n" , resource, res, conflict->name, conflict); res->flags |=IORESOURCE_UNSET ;return -EBUSY ;
@@ -172,7 +172,7 @@ EXPORT_SYMBOL(pci_claim_resource);void pci_disable_bridge_window (struct pci_dev *dev) { -dev_info (&dev->dev,"disabling bridge mem windows\n" ); +pci_info (dev,"disabling bridge mem windows\n" );/* MMIO Base/Limit */ pci_write_config_dword (dev,PCI_MEMORY_BASE ,0x0000fff0 );
@@ -221,11 +221,11 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev, root = &iomem_resource; } -dev_info (&dev->dev,"BAR %d: trying firmware assignment %pR\n" , +pci_info (dev,"BAR %d: trying firmware assignment %pR\n" , resno, res); conflict =request_resource_conflict (root, res);if (conflict) { -dev_info (&dev->dev,"BAR %d: %pR conflicts with %s %pR\n" , +pci_info (dev,"BAR %d: %pR conflicts with %s %pR\n" , resno, res, conflict->name, conflict); res->start = start; res->end = end;
@@ -324,7 +324,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno) res->flags |=IORESOURCE_UNSET ; align =pci_resource_alignment (dev, res);if (!align) { -dev_info (&dev->dev,"BAR %d: can't assign %pR (bogus alignment)\n" , +pci_info (dev,"BAR %d: can't assign %pR (bogus alignment)\n" , resno, res);return -EINVAL ; }
@@ -338,19 +338,19 @@ int pci_assign_resource(struct pci_dev *dev, int resno)* working, which is better than just leaving it disabled. */ if (ret <0 ) { -dev_info (&dev->dev,"BAR %d: no space for %pR\n" , resno, res); +pci_info (dev,"BAR %d: no space for %pR\n" , resno, res); ret =pci_revert_fw_address (res, dev, resno, size); }if (ret <0 ) { -dev_info (&dev->dev,"BAR %d: failed to assign %pR\n" , resno, +pci_info (dev,"BAR %d: failed to assign %pR\n" , resno, res);return ret; } res->flags &= ~IORESOURCE_UNSET ; res->flags &= ~IORESOURCE_STARTALIGN ; -dev_info (&dev->dev,"BAR %d: assigned %pR\n" , resno, res); +pci_info (dev,"BAR %d: assigned %pR\n" , resno, res);if (resno <PCI_BRIDGE_RESOURCES )pci_update_resource (dev, resno);
@@ -372,7 +372,7 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz flags = res->flags; res->flags |=IORESOURCE_UNSET ;if (!res->parent) { -dev_info (&dev->dev,"BAR %d: can't reassign an unassigned resource %pR\n" , +pci_info (dev,"BAR %d: can't reassign an unassigned resource %pR\n" , resno, res);return -EINVAL ; }
@@ -382,14 +382,14 @@ int pci_reassign_resource(struct pci_dev *dev, int resno, resource_size_t addsiz ret =_pci_assign_resource (dev, resno, new_size, min_align);if (ret) { res->flags = flags; -dev_info (&dev->dev,"BAR %d: %pR (failed to expand by %#llx)\n" , +pci_info (dev,"BAR %d: %pR (failed to expand by %#llx)\n" , resno, res, (unsigned long long ) addsize);return ret; } res->flags &= ~IORESOURCE_UNSET ; res->flags &= ~IORESOURCE_STARTALIGN ; -dev_info (&dev->dev,"BAR %d: reassigned %pR (expanded by %#llx)\n" , +pci_info (dev,"BAR %d: reassigned %pR (expanded by %#llx)\n" , resno, res, (unsigned long long ) addsize);if (resno <PCI_BRIDGE_RESOURCES )pci_update_resource (dev, resno);
@@ -401,7 +401,7 @@ void pci_release_resource(struct pci_dev *dev, int resno) {struct resource *res = dev->resource + resno; -dev_info (&dev->dev,"BAR %d: releasing %pR\n" , resno, res); +pci_info (dev,"BAR %d: releasing %pR\n" , resno, res);release_resource (res); res->end =resource_size (res) -1 ; res->start =0 ;
@@ -477,13 +477,13 @@ int pci_enable_resources(struct pci_dev *dev, int mask)continue ;if (r->flags &IORESOURCE_UNSET ) { -dev_err (&dev->dev,"can't enable device: BAR %d %pR not assigned\n" , +pci_err (dev,"can't enable device: BAR %d %pR not assigned\n" , i, r);return -EINVAL ; }if (!r->parent) { -dev_err (&dev->dev,"can't enable device: BAR %d %pR not claimed\n" , +pci_err (dev,"can't enable device: BAR %d %pR not claimed\n" , i, r);return -EINVAL ; }
@@ -495,7 +495,7 @@ int pci_enable_resources(struct pci_dev *dev, int mask) }if (cmd != old_cmd) { -dev_info (&dev->dev,"enabling device (%04x -> %04x)\n" , +pci_info (dev,"enabling device (%04x -> %04x)\n" , old_cmd, cmd);pci_write_config_word (dev,PCI_COMMAND , cmd); }
drivers/pci/vc.c +8 -8
@@ -57,7 +57,7 @@ static void pci_vc_load_arb_table(struct pci_dev *dev, int pos) PCI_VC_PORT_STATUS_TABLE))return ; -dev_err (&dev->dev,"VC arbitration table failed to load\n" ); +pci_err (dev,"VC arbitration table failed to load\n" ); }/**
@@ -85,7 +85,7 @@ static void pci_vc_load_port_arb_table(struct pci_dev *dev, int pos, int res)if (pci_wait_for_pending (dev, status_pos,PCI_VC_RES_STATUS_TABLE ))return ; -dev_err (&dev->dev,"VC%d port arbitration table failed to load\n" , res); +pci_err (dev,"VC%d port arbitration table failed to load\n" , res); }/**
@@ -161,11 +161,11 @@ static void pci_vc_enable(struct pci_dev *dev, int pos, int res)pci_write_config_dword (dev, ctrl_pos, ctrl);if (!pci_wait_for_pending (dev, status_pos,PCI_VC_RES_STATUS_NEGO )) -dev_err (&dev->dev,"VC%d negotiation stuck pending\n" , id); +pci_err (dev,"VC%d negotiation stuck pending\n" , id);if (link && !pci_wait_for_pending (link, status_pos2,PCI_VC_RES_STATUS_NEGO )) -dev_err (&link->dev,"VC%d negotiation stuck pending\n" , id); +pci_err (link,"VC%d negotiation stuck pending\n" , id); }/**
@@ -195,7 +195,7 @@ static int pci_vc_do_save_buffer(struct pci_dev *dev, int pos,/* Sanity check buffer size for save/restore */ if (buf && save_state->cap.size !=pci_vc_do_save_buffer (dev, pos,NULL , save)) { -dev_err (&dev->dev, +pci_err (dev,"VC save buffer size does not match @0x%x\n" , pos);return -ENOMEM ; }
@@ -366,14 +366,14 @@ int pci_save_vc_state(struct pci_dev *dev) save_state =pci_find_saved_ext_cap (dev, vc_caps[i].id);if (!save_state) { -dev_err (&dev->dev,"%s buffer not found in %s\n" , +pci_err (dev,"%s buffer not found in %s\n" , vc_caps[i].name, __func__);return -ENOMEM ; } ret =pci_vc_do_save_buffer (dev, pos, save_state, true);if (ret) { -dev_err (&dev->dev,"%s save unsuccessful %s\n" , +pci_err (dev,"%s save unsuccessful %s\n" , vc_caps[i].name, __func__);return ret; }
@@ -426,7 +426,7 @@ void pci_allocate_vc_save_buffers(struct pci_dev *dev) len =pci_vc_do_save_buffer (dev, pos,NULL , false);if (pci_add_ext_cap_save_buffer (dev, vc_caps[i].id, len)) -dev_err (&dev->dev, +pci_err (dev,"unable to preallocate %s save buffer\n" , vc_caps[i].name); }
drivers/pci/xen-pcifront.c +8 -8
@@ -261,7 +261,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,struct msi_desc *entry;if (nvec >SH_INFO_MAX_VEC ) { -dev_err (&dev->dev,"too much vector for pci frontend: %x." +pci_err (dev,"too much vector for pci frontend: %x." " Increase SH_INFO_MAX_VEC.\n" , nvec);return -EINVAL ; }
@@ -281,7 +281,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,/* we get the result */ for (i =0 ; i < nvec; i++) {if (op.msix_entries[i].vector <=0 ) { -dev_warn (&dev->dev,"MSI-X entry %d is invalid: %d!\n" , +pci_warn (dev,"MSI-X entry %d is invalid: %d!\n" , i, op.msix_entries[i].vector); err = -EINVAL ; vector[i] =-1 ;
@@ -295,7 +295,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev, err = op.value; } }else { -dev_err (&dev->dev,"enable msix get err %x\n" , err); +pci_err (dev,"enable msix get err %x\n" , err); }return err; }
@@ -316,7 +316,7 @@ static void pci_frontend_disable_msix(struct pci_dev *dev)/* What should do for error ? */ if (err) -dev_err (&dev->dev,"pci_disable_msix get err %x\n" , err); +pci_err (dev,"pci_disable_msix get err %x\n" , err); }static int pci_frontend_enable_msi (struct pci_dev *dev,int vector[])
@@ -335,13 +335,13 @@ static int pci_frontend_enable_msi(struct pci_dev *dev, int vector[])if (likely (!err)) { vector[0 ] = op.value;if (op.value <=0 ) { -dev_warn (&dev->dev,"MSI entry is invalid: %d!\n" , +pci_warn (dev,"MSI entry is invalid: %d!\n" , op.value); err = -EINVAL ; vector[0 ] =-1 ; } }else { -dev_err (&dev->dev,"pci frontend enable msi failed for dev " +pci_err (dev,"pci frontend enable msi failed for dev " "%x:%x\n" , op.bus, op.devfn); err = -EINVAL ; }
@@ -560,7 +560,7 @@ static void free_root_bus_devs(struct pci_bus *bus)while (!list_empty (&bus->devices)) { dev = container_of(bus->devices.next, struct pci_dev, bus_list); -dev_dbg (&dev->dev,"removing device\n" ); +pci_dbg (dev,"removing device\n" );pci_stop_and_remove_bus_device (dev); } }
@@ -613,7 +613,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,if (pdrv) {if (pdrv->err_handler && pdrv->err_handler->error_detected) { -dev_dbg (&pcidev->dev, +pci_dbg (pcidev,"trying to call AER service\n" );if (pcidev) { flag =1 ;
Signature · 1 line
2.7.4
Bjorn Helgaas
AppliedQuoted 18 lines · Frederick Lawler
Replace current uses of dev_<level> with pci_<level> by adding and using PCI specific fuctions.
Frederick Lawler (2):
PCI: Create minorpci_devlog wrapper functions
PCI: Replace calls from dev_<level> to pci_<level>drivers/pci/access.c | 6 +- drivers/pci/bus.c | 4 +- drivers/pci/iov.c | 10 +-- drivers/pci/irq.c | 6 +- drivers/pci/msi.c | 6 +- drivers/pci/pci-acpi.c | 2 +- drivers/pci/pci-stub.c | 2 +- drivers/pci/pci-sysfs.c | 10 +-- drivers/pci/pci.c | 76 ++++++++--------- drivers/pci/probe.c | 74 ++++++++--------- drivers/pci/quirks.c | 198 ++++++++++++++++++++++-----------------------
Quoted 8 lines
drivers/pci/rom.c | 4 +- drivers/pci/setup-bus.c | 44 +++++----- drivers/pci/setup-irq.c | 4 +- drivers/pci/setup-res.c | 38 ++++----- drivers/pci/vc.c | 16 ++-- drivers/pci/xen-pcifront.c | 16 ++-- include/linux/pci.h | 91 +++++++++++++++++++++ 18 files changed, 349 insertions(+), 258 deletions(-)
Applied to pci/misc for v4.16, thanks!
I also updated a few more files in hotplug, AER, ASPM, PME, and PTM, so if it breaks, it's probably my fault.