* [PATCH] i2c-pxa2xx: fix missing pci_disable_device() on error in ce4100_i2c_probe
@ 2022-11-14 9:25 Hui Tang
2022-12-05 10:01 ` Wolfram Sang
0 siblings, 1 reply; 2+ messages in thread
From: Hui Tang @ 2022-11-14 9:25 UTC (permalink / raw)
To: linux-i2c, linux, bence98; +Cc: linux-kernel, weiyongjun1, yusongping
Using pcim_enable_device() to avoid missing pci_disable_device().
Fixes: 7e94dd154e934 ("i2c-pxa2xx: Add PCI support for PXA I2C controller")
Signed-off-by: Hui Tang <tanghui20@huawei.com>
---
drivers/i2c/busses/i2c-pxa-pci.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c
index f614cade432b..30e38bc8b6db 100644
--- a/drivers/i2c/busses/i2c-pxa-pci.c
+++ b/drivers/i2c/busses/i2c-pxa-pci.c
@@ -105,7 +105,7 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
int i;
struct ce4100_devices *sds;
- ret = pci_enable_device_mem(dev);
+ ret = pcim_enable_device(dev);
if (ret)
return ret;
@@ -114,10 +114,8 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
return -EINVAL;
}
sds = kzalloc(sizeof(*sds), GFP_KERNEL);
- if (!sds) {
- ret = -ENOMEM;
- goto err_mem;
- }
+ if (!sds)
+ return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {
sds->pdev[i] = add_i2c_device(dev, i);
@@ -133,8 +131,6 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
err_dev_add:
kfree(sds);
-err_mem:
- pci_disable_device(dev);
return ret;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c-pxa2xx: fix missing pci_disable_device() on error in ce4100_i2c_probe
2022-11-14 9:25 [PATCH] i2c-pxa2xx: fix missing pci_disable_device() on error in ce4100_i2c_probe Hui Tang
@ 2022-12-05 10:01 ` Wolfram Sang
0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2022-12-05 10:01 UTC (permalink / raw)
To: Hui Tang; +Cc: linux-i2c, linux, bence98, linux-kernel, weiyongjun1, yusongping
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
On Mon, Nov 14, 2022 at 05:25:40PM +0800, Hui Tang wrote:
> Using pcim_enable_device() to avoid missing pci_disable_device().
>
> Fixes: 7e94dd154e934 ("i2c-pxa2xx: Add PCI support for PXA I2C controller")
> Signed-off-by: Hui Tang <tanghui20@huawei.com>
Fixed the subject to "i2c: pxa-pci:" and fixed this checkpatch warning:
WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: 7e94dd154e93 ("i2c-pxa2xx: Add PCI support for PXA I2C controller")'
#3:
Fixes: 7e94dd154e934 ("i2c-pxa2xx: Add PCI support for PXA I2C controller")
Please do that in the future. After all that, applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-05 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 9:25 [PATCH] i2c-pxa2xx: fix missing pci_disable_device() on error in ce4100_i2c_probe Hui Tang
2022-12-05 10:01 ` Wolfram Sang
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.