diff options
author | Hui Tang <tanghui20@huawei.com> | 2022-11-14 17:25:40 +0800 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-12-05 11:00:34 +0100 |
commit | d78a167332e1ca8113268ed922c1212fd71b73ad (patch) | |
tree | 6a3d6fdc7275bcba2602170054d35b74a0b90796 /drivers/i2c/busses/i2c-pxa-pci.c | |
parent | 87ab726952267caabb9c1404e007e16e42f03b52 (diff) | |
download | lwn-d78a167332e1ca8113268ed922c1212fd71b73ad.tar.gz lwn-d78a167332e1ca8113268ed922c1212fd71b73ad.zip |
i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe
Using pcim_enable_device() to avoid missing pci_disable_device().
Fixes: 7e94dd154e93 ("i2c-pxa2xx: Add PCI support for PXA I2C controller")
Signed-off-by: Hui Tang <tanghui20@huawei.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-pxa-pci.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa-pci.c | 10 |
1 files 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; } |