diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-01-05 16:19:34 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-02-15 10:05:02 +0100 |
commit | c74a30ce137636d1a12abde357718e45524c2b71 (patch) | |
tree | 28e52a8abef170caf2c40cd2870cef9f5d777201 /drivers/i2c | |
parent | c2c25be6dc94132bca85f5b2c6ee9f6d7ab0173f (diff) | |
download | lwn-c74a30ce137636d1a12abde357718e45524c2b71.tar.gz lwn-c74a30ce137636d1a12abde357718e45524c2b71.zip |
i2c: nvidia-gpu: Convert to use dev_err_probe()
It's fine to call dev_err_probe() in ->probe() when error code is known.
Convert the driver to use dev_err_probe().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-nvidia-gpu.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/i2c/busses/i2c-nvidia-gpu.c b/drivers/i2c/busses/i2c-nvidia-gpu.c index a82be377146e..6920c1b9a126 100644 --- a/drivers/i2c/busses/i2c-nvidia-gpu.c +++ b/drivers/i2c/busses/i2c-nvidia-gpu.c @@ -282,24 +282,18 @@ static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_id *id) dev_set_drvdata(dev, i2cd); status = pcim_enable_device(pdev); - if (status < 0) { - dev_err(dev, "pcim_enable_device failed %d\n", status); - return status; - } + if (status < 0) + return dev_err_probe(dev, status, "pcim_enable_device failed\n"); pci_set_master(pdev); i2cd->regs = pcim_iomap(pdev, 0, 0); - if (!i2cd->regs) { - dev_err(dev, "pcim_iomap failed\n"); - return -ENOMEM; - } + if (!i2cd->regs) + return dev_err_probe(dev, -ENOMEM, "pcim_iomap failed\n"); status = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI); - if (status < 0) { - dev_err(dev, "pci_alloc_irq_vectors err %d\n", status); - return status; - } + if (status < 0) + return dev_err_probe(dev, status, "pci_alloc_irq_vectors err\n"); gpu_enable_i2c_bus(i2cd); |