Commit c74a30ce authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Wolfram Sang

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent c2c25be6
...@@ -282,24 +282,18 @@ static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -282,24 +282,18 @@ static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev_set_drvdata(dev, i2cd); dev_set_drvdata(dev, i2cd);
status = pcim_enable_device(pdev); status = pcim_enable_device(pdev);
if (status < 0) { if (status < 0)
dev_err(dev, "pcim_enable_device failed %d\n", status); return dev_err_probe(dev, status, "pcim_enable_device failed\n");
return status;
}
pci_set_master(pdev); pci_set_master(pdev);
i2cd->regs = pcim_iomap(pdev, 0, 0); i2cd->regs = pcim_iomap(pdev, 0, 0);
if (!i2cd->regs) { if (!i2cd->regs)
dev_err(dev, "pcim_iomap failed\n"); return dev_err_probe(dev, -ENOMEM, "pcim_iomap failed\n");
return -ENOMEM;
}
status = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI); status = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
if (status < 0) { if (status < 0)
dev_err(dev, "pci_alloc_irq_vectors err %d\n", status); return dev_err_probe(dev, status, "pci_alloc_irq_vectors err\n");
return status;
}
gpu_enable_i2c_bus(i2cd); gpu_enable_i2c_bus(i2cd);
......
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