Commit 34438ba6 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes

PCIE: port driver: use dev_printk when possible

Convert printks to use dev_printk().
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 531f254e
...@@ -23,20 +23,20 @@ static int pcie_port_probe_service(struct device *dev) ...@@ -23,20 +23,20 @@ static int pcie_port_probe_service(struct device *dev)
{ {
struct pcie_device *pciedev; struct pcie_device *pciedev;
struct pcie_port_service_driver *driver; struct pcie_port_service_driver *driver;
int status = -ENODEV; int status;
if (!dev || !dev->driver) if (!dev || !dev->driver)
return status; return -ENODEV;
driver = to_service_driver(dev->driver); driver = to_service_driver(dev->driver);
if (!driver || !driver->probe) if (!driver || !driver->probe)
return status; return -ENODEV;
pciedev = to_pcie_device(dev); pciedev = to_pcie_device(dev);
status = driver->probe(pciedev, driver->id_table); status = driver->probe(pciedev, driver->id_table);
if (!status) { if (!status) {
printk(KERN_DEBUG "Load service driver %s on pcie device %s\n", dev_printk(KERN_DEBUG, dev, "service driver %s loaded\n",
driver->name, dev->bus_id); driver->name);
get_device(dev); get_device(dev);
} }
return status; return status;
...@@ -53,8 +53,8 @@ static int pcie_port_remove_service(struct device *dev) ...@@ -53,8 +53,8 @@ static int pcie_port_remove_service(struct device *dev)
pciedev = to_pcie_device(dev); pciedev = to_pcie_device(dev);
driver = to_service_driver(dev->driver); driver = to_service_driver(dev->driver);
if (driver && driver->remove) { if (driver && driver->remove) {
printk(KERN_DEBUG "Unload service driver %s on pcie device %s\n", dev_printk(KERN_DEBUG, dev, "unloading service driver %s\n",
driver->name, dev->bus_id); driver->name);
driver->remove(pciedev); driver->remove(pciedev);
put_device(dev); put_device(dev);
} }
...@@ -103,7 +103,7 @@ static int pcie_port_resume_service(struct device *dev) ...@@ -103,7 +103,7 @@ static int pcie_port_resume_service(struct device *dev)
*/ */
static void release_pcie_device(struct device *dev) static void release_pcie_device(struct device *dev)
{ {
printk(KERN_DEBUG "Free Port Service[%s]\n", dev->bus_id); dev_printk(KERN_DEBUG, dev, "free port service\n");
kfree(to_pcie_device(dev)); kfree(to_pcie_device(dev));
} }
...@@ -150,7 +150,7 @@ static int assign_interrupt_mode(struct pci_dev *dev, int *vectors, int mask) ...@@ -150,7 +150,7 @@ static int assign_interrupt_mode(struct pci_dev *dev, int *vectors, int mask)
if (pos) { if (pos) {
struct msix_entry msix_entries[PCIE_PORT_DEVICE_MAXSERVICES] = struct msix_entry msix_entries[PCIE_PORT_DEVICE_MAXSERVICES] =
{{0, 0}, {0, 1}, {0, 2}, {0, 3}}; {{0, 0}, {0, 1}, {0, 2}, {0, 3}};
printk("%s Found MSIX capability\n", __func__); dev_info(&dev->dev, "found MSI-X capability\n");
status = pci_enable_msix(dev, msix_entries, nvec); status = pci_enable_msix(dev, msix_entries, nvec);
if (!status) { if (!status) {
int j = 0; int j = 0;
...@@ -165,7 +165,7 @@ static int assign_interrupt_mode(struct pci_dev *dev, int *vectors, int mask) ...@@ -165,7 +165,7 @@ static int assign_interrupt_mode(struct pci_dev *dev, int *vectors, int mask)
if (status) { if (status) {
pos = pci_find_capability(dev, PCI_CAP_ID_MSI); pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
if (pos) { if (pos) {
printk("%s Found MSI capability\n", __func__); dev_info(&dev->dev, "found MSI capability\n");
status = pci_enable_msi(dev); status = pci_enable_msi(dev);
if (!status) { if (!status) {
interrupt_mode = PCIE_PORT_MSI_MODE; interrupt_mode = PCIE_PORT_MSI_MODE;
...@@ -252,7 +252,7 @@ static struct pcie_device* alloc_pcie_device(struct pci_dev *parent, ...@@ -252,7 +252,7 @@ static struct pcie_device* alloc_pcie_device(struct pci_dev *parent,
return NULL; return NULL;
pcie_device_init(parent, device, port_type, service_type, irq,irq_mode); pcie_device_init(parent, device, port_type, service_type, irq,irq_mode);
printk(KERN_DEBUG "Allocate Port Service[%s]\n", device->device.bus_id); dev_printk(KERN_DEBUG, &device->device, "allocate port service\n");
return device; return device;
} }
......
...@@ -91,9 +91,8 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev, ...@@ -91,9 +91,8 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
pci_set_master(dev); pci_set_master(dev);
if (!dev->irq && dev->pin) { if (!dev->irq && dev->pin) {
printk(KERN_WARNING dev_warn(&dev->dev, "device [%04x/%04x] has invalid IRQ; "
"%s->Dev[%04x:%04x] has invalid IRQ. Check vendor BIOS\n", "check vendor BIOS\n", dev->vendor, dev->device);
__func__, dev->vendor, dev->device);
} }
if (pcie_port_device_register(dev)) { if (pcie_port_device_register(dev)) {
pci_disable_device(dev); pci_disable_device(dev);
......
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