From patchwork Mon Nov 14 09:25:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Tang X-Patchwork-Id: 19629 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2055962wru; Mon, 14 Nov 2022 01:45:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Gs1qLQPfd7g0q99slNFkHih8El5pIXyMQDeAUxEUMmM0Q0Ujt1iO8kLryid6qeC6Swxc3 X-Received: by 2002:a05:6402:d77:b0:459:aa70:d4fd with SMTP id ec55-20020a0564020d7700b00459aa70d4fdmr10153436edb.162.1668419102210; Mon, 14 Nov 2022 01:45:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668419102; cv=none; d=google.com; s=arc-20160816; b=Pug+g6EbAEl7XjAZjiCSvYDkPwzCop/FXy+zmDGQstWWpyojHVRic8kuUzpfOhJOXG eiHWaKEEvaWnfyoL1fXj8thR7hijdSBerNF/zd1bvasVZMDuaZ30eqToVaPLd5wSJvR6 drEgRnebN30K20pbZz925CYXAUQZtYlOurBpKSMyE9JowvHQ0mp8zqo8uT3pn7dVX6o0 BGNvSNwcNZTWv0L0cnqRbUPu28y05AmCWSXW5k7TUvl4D33DQM6ZcxUHsYZZxLu5/QOi ZoKsN8Z8KhMxUOCFqr66Gcz7bV4XAQoIqYLWbehlk5H+gpoweWOhJqF0NOuX1niC8XRG FcDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=6KdgU7iyWUZ3cxQhY7doqJCFcr9J8JlYhEEQcVL1k6A=; b=Y0TqnFkQWyY6XsxCsWDbDVCXRji1/XJGGaf1y6CqasyJ5bkNFtJAgjWPnTOvoGqk8r WbnhpE9NggUGdpZH4eJ049NBhcZJfOma5B0I+scBf564Za56sHHiLpfpSb4+0fBXQSiO qS3nn/an9yTcWvn+BnJ1mYb9wCoFoTbHk0xyaZ3RrPEKf2xeK9bE0BZM4sU+3AcEkmXf mBEZ6s2TmZ1N4qzc8tSpKqMH0qgI7lCZOcvDxRgbb3YIEg9xHZVX9dwvhH+vLIdQR/5o sdC0yXVSi0ihHzYA+L4EYxug3fmh8WedPNZ3Vv9xxRSA4fRg3Rd1SV082YF05I/KYbuu 0gGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a18-20020a1709063a5200b007ad9885d2b1si6596420ejf.301.2022.11.14.01.44.38; Mon, 14 Nov 2022 01:45:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236253AbiKNJ3M (ORCPT + 99 others); Mon, 14 Nov 2022 04:29:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235933AbiKNJ3J (ORCPT ); Mon, 14 Nov 2022 04:29:09 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34A47658; Mon, 14 Nov 2022 01:29:08 -0800 (PST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N9kWn2DNrzHw3N; Mon, 14 Nov 2022 17:28:37 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 14 Nov 2022 17:28:51 +0800 Received: from ubuntu1804.huawei.com (10.67.175.30) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 14 Nov 2022 17:28:51 +0800 From: Hui Tang To: , , CC: , , Subject: [PATCH] i2c-pxa2xx: fix missing pci_disable_device() on error in ce4100_i2c_probe Date: Mon, 14 Nov 2022 17:25:40 +0800 Message-ID: <20221114092540.247891-1-tanghui20@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.30] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749464228389244824?= X-GMAIL-MSGID: =?utf-8?q?1749464228389244824?= 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 --- 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; }