Skip to content

Commit

Permalink
drivers: gpio: bt8xx: prefer dev_err()/dev_warn() over of raw printk
Browse files Browse the repository at this point in the history
For logging in device contexts, dev_*() functions are preferred over
raw printk(), which also print out device name.

Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
metux authored and linusw committed Dec 8, 2020
1 parent dd0fa81 commit 3bf1d26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpio/gpio-bt8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ static int bt8xxgpio_probe(struct pci_dev *dev,

err = pci_enable_device(dev);
if (err) {
printk(KERN_ERR "bt8xxgpio: Can't enable device.\n");
dev_err(&dev->dev, "can't enable device.\n");
return err;
}
if (!devm_request_mem_region(&dev->dev, pci_resource_start(dev, 0),
pci_resource_len(dev, 0),
"bt8xxgpio")) {
printk(KERN_WARNING "bt8xxgpio: Can't request iomem (0x%llx).\n",
dev_warn(&dev->dev, "can't request iomem (0x%llx).\n",
(unsigned long long)pci_resource_start(dev, 0));
err = -EBUSY;
goto err_disable;
Expand All @@ -191,7 +191,7 @@ static int bt8xxgpio_probe(struct pci_dev *dev,

bg->mmio = devm_ioremap(&dev->dev, pci_resource_start(dev, 0), 0x1000);
if (!bg->mmio) {
printk(KERN_ERR "bt8xxgpio: ioremap() failed\n");
dev_err(&dev->dev, "ioremap() failed\n");
err = -EIO;
goto err_disable;
}
Expand All @@ -207,7 +207,7 @@ static int bt8xxgpio_probe(struct pci_dev *dev,
bt8xxgpio_gpio_setup(bg);
err = gpiochip_add_data(&bg->gpio, bg);
if (err) {
printk(KERN_ERR "bt8xxgpio: Failed to register GPIOs\n");
dev_err(&dev->dev, "failed to register GPIOs\n");
goto err_disable;
}

Expand Down

0 comments on commit 3bf1d26

Please sign in to comment.