From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Wolfram Sang <wsa@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Ajay Gupta <ajayg@nvidia.com>,
"Shah, Nehal-bakulchandra" <nehal-bakulchandra.shah@amd.com>
Subject: [PATCH v3 4/5] i2c: nvidia-gpu: Convert to use dev_err_probe()
Date: Wed, 5 Jan 2022 16:19:34 +0200 [thread overview]
Message-ID: <20220105141935.24109-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220105141935.24109-1-andriy.shevchenko@linux.intel.com>
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>
---
v3: no changes
drivers/i2c/busses/i2c-nvidia-gpu.c | 18 ++++++------------
1 file 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);
--
2.34.1
next prev parent reply other threads:[~2022-01-05 14:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 14:19 [PATCH v3 1/5] i2c: Introduce common module to instantiate CCGx UCSI Andy Shevchenko
2022-01-05 14:19 ` [PATCH v3 2/5] i2c: nvidia-gpu: Switch to use i2c_new_ccgx_ucsi() Andy Shevchenko
2022-02-15 9:08 ` Wolfram Sang
2022-01-05 14:19 ` [PATCH v3 3/5] i2c: nvidia-gpu: Use temporary variable for struct device Andy Shevchenko
2022-02-15 9:08 ` Wolfram Sang
2022-01-05 14:19 ` Andy Shevchenko [this message]
2022-02-15 9:08 ` [PATCH v3 4/5] i2c: nvidia-gpu: Convert to use dev_err_probe() Wolfram Sang
2022-01-05 14:19 ` [PATCH v3 5/5] i2c: designware-pci: Switch to use i2c_new_ccgx_ucsi() Andy Shevchenko
2022-02-15 9:08 ` Wolfram Sang
2022-01-24 15:06 ` [PATCH v3 1/5] i2c: Introduce common module to instantiate CCGx UCSI Andy Shevchenko
2022-02-07 13:13 ` Andy Shevchenko
2022-02-07 14:14 ` Wolfram Sang
2022-02-07 14:39 ` Andy Shevchenko
2022-02-15 9:10 ` Wolfram Sang
2022-02-15 9:45 ` Andy Shevchenko
2022-02-15 12:46 ` Wolfram Sang
2022-02-15 17:41 ` Ajay Gupta
2022-02-15 9:07 ` Wolfram Sang
2022-02-15 9:46 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220105141935.24109-4-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=ajayg@nvidia.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=nehal-bakulchandra.shah@amd.com \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.