From patchwork Tue Feb 16 14:18:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dejin Zheng X-Patchwork-Id: 12090057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6996AC433E9 for ; Tue, 16 Feb 2021 14:19:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32DCD64E09 for ; Tue, 16 Feb 2021 14:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230125AbhBPOTL (ORCPT ); Tue, 16 Feb 2021 09:19:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230063AbhBPOTG (ORCPT ); Tue, 16 Feb 2021 09:19:06 -0500 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAC63C06174A; Tue, 16 Feb 2021 06:18:25 -0800 (PST) Received: by mail-pg1-x52d.google.com with SMTP id a4so4713337pgc.11; Tue, 16 Feb 2021 06:18:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0/8Il2KLbNbOGHiJUWvZA0jL3sPtcEjc8WP9wNcAlZk=; b=i+8yGkvyXnFawzBJaQeJeNLyHN8GPMWrnL/qrcpTbvyuFL4dXw0DH0G3ZRr4gOfdbJ 76M5vxFU1yMcdqXWnq4St58S/C+uiSG4RP5ycpK7Av2XMfH8xT+IfvOfxd+eqJlJmFKi R0z2n4fvcNzTPj5hJk0O4P+h4H4hRyRTFZLejB/YMKDTOJYhZrV4iSwekemaKd93bOF+ af4eusqQHAJtyrZv3NRtkEJrreF1y/mAUFyc95LD3iGMAX76roSarih1Py7XuDcjYYz2 ZDViGoJ6akNmUIEHZH+5pVkHVKiFqVWMiCi8svMQK+4WPuAhi9065UnHLqqTYau/LHOq 0XaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0/8Il2KLbNbOGHiJUWvZA0jL3sPtcEjc8WP9wNcAlZk=; b=g4ebU2avDxlsHlfOCLp9IzAfwitlfYqYanDPDsvqFO3ZnC3P7scWl9yQixGeJMcrLa qXVvBzT5eisHpETArJ2d6hevbNqmOM+5+jSSeqjuJFZ5MHmL0A8PzAL5FVyBYkOwZ0y8 TelB9+gzcWq+xedWILzcnpizcQcOCNKUxRn21f31blexu9g/0uX6ibk4HyxJNoxegIhy nyOfxQj7bIN5SdRWdGJzETXqinet0R6XJnSMXFGo31uPUAHlonUdf7SXrEi7qOEiMLt5 kMhZOdczgRvrRl03XkdZwpT70QLieTpmGev5ifGInNTX+kR5EAHvUJnQ++63T2wA2W8S XOEA== X-Gm-Message-State: AOAM533lCblvEtMDLlnZRg2IMk35wLO8Vz3bZCjQL7I14IepCqPP4kI0 zqBb7OVPbag5OKsTmsq+c3I= X-Google-Smtp-Source: ABdhPJw5hP7I6Z9nf+GdtLNCzGLx5XXOmW3OybnlqHSriIRJehMfbKYJ1DrzUCrr3U1CQBrfB9YW8g== X-Received: by 2002:aa7:9293:0:b029:1df:4e2:c981 with SMTP id j19-20020aa792930000b02901df04e2c981mr20041589pfa.41.1613485105342; Tue, 16 Feb 2021 06:18:25 -0800 (PST) Received: from localhost (185.212.56.4.16clouds.com. [185.212.56.4]) by smtp.gmail.com with ESMTPSA id p12sm3003259pjz.34.2021.02.16.06.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 06:18:25 -0800 (PST) From: Dejin Zheng To: corbet@lwn.net, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, rric@kernel.org, bhelgaas@google.com, wsa@kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, kw@linux.com Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH v2 1/4] PCI: Introduce pcim_alloc_irq_vectors() Date: Tue, 16 Feb 2021 22:18:07 +0800 Message-Id: <20210216141810.747678-2-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20210216141810.747678-1-zhengdejin5@gmail.com> References: <20210216141810.747678-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Introduce pcim_alloc_irq_vectors(), a device-managed version of pci_alloc_irq_vectors(). Introducing this function can simplify the error handling path in many drivers. Suggested-by: Andy Shevchenko Signed-off-by: Dejin Zheng --- v1 -> v2: - Use pci_free_irq_vectors() to replace some code in pcim_release(). - Modify some commit messages. drivers/pci/pci.c | 33 +++++++++++++++++++++++++++++---- include/linux/pci.h | 3 +++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b67c4327d307..db799d089c85 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1969,10 +1969,7 @@ static void pcim_release(struct device *gendev, void *res) struct pci_devres *this = res; int i; - if (dev->msi_enabled) - pci_disable_msi(dev); - if (dev->msix_enabled) - pci_disable_msix(dev); + pci_free_irq_vectors(dev); for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) if (this->region_mask & (1 << i)) @@ -2054,6 +2051,34 @@ void pcim_pin_device(struct pci_dev *pdev) } EXPORT_SYMBOL(pcim_pin_device); +/** + * pcim_alloc_irq_vectors - a device-managed pci_alloc_irq_vectors() + * @dev: PCI device to operate on + * @min_vecs: minimum number of vectors required (must be >= 1) + * @max_vecs: maximum (desired) number of vectors + * @flags: flags or quirks for the allocation + * + * Return the number of vectors allocated, (which might be smaller than + * @max_vecs) if successful, or a negative error code on error. If less + * than @min_vecs interrupt vectors are available for @dev the function + * will fail with -ENOSPC. + * + * It depends on calling pcim_enable_device() to make IRQ resources + * manageable. + */ +int pcim_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, + unsigned int max_vecs, unsigned int flags) +{ + struct pci_devres *dr; + + dr = find_pci_dr(dev); + if (!dr || !dr->enabled) + return -EINVAL; + + return pci_alloc_irq_vectors(dev, min_vecs, max_vecs, flags); +} +EXPORT_SYMBOL(pcim_alloc_irq_vectors); + /* * pcibios_add_device - provide arch specific hooks when adding device dev * @dev: the PCI device being added diff --git a/include/linux/pci.h b/include/linux/pci.h index 86c799c97b77..d75ba85ddfc5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1818,6 +1818,9 @@ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, NULL); } +int pcim_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, + unsigned int max_vecs, unsigned int flags); + /* Include architecture-dependent settings and functions */ #include From patchwork Tue Feb 16 14:18:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dejin Zheng X-Patchwork-Id: 12090059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0D1AC433E6 for ; Tue, 16 Feb 2021 14:19:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8920E64E02 for ; Tue, 16 Feb 2021 14:19:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbhBPOTQ (ORCPT ); Tue, 16 Feb 2021 09:19:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230128AbhBPOTL (ORCPT ); Tue, 16 Feb 2021 09:19:11 -0500 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 050D3C061756; Tue, 16 Feb 2021 06:18:31 -0800 (PST) Received: by mail-pj1-x1031.google.com with SMTP id l18so6013318pji.3; Tue, 16 Feb 2021 06:18:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zjaOOeSZGEGtGWhCG3YiZONTXpJPR1CoglJJC/wPq8k=; b=RrVghl0SP20X6/Q1pUmqyM8D6ib+ZfrRttGqQGYTpbllLk6bw6oQXDvzmWffmlziK9 4MH+1J20JOsq8kDFI4jdMifozCjm+/hPXdHfTJsDLJhNbuMhZ8Z9AxY7qXGjwvrCq3l4 5/2EaFlT+rW0LtGZLIhqYJrOV97iOt++VurOTOnRjt3qAtNpfSTUA7SKCPon0oFrhhAw vleus6/LhqbSbuaGRzx0Xmwtf3zjHQbYw6ZDlaJjOE6MHWhFFHcDW+RG7Me+lFVtF5tU U1kOAWuGzpzVQWsn8EG6clHmOkcdzoHOWQdQQAhVvOV4a1FkcIUbczp1G43S8hTAg6xD Z6+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zjaOOeSZGEGtGWhCG3YiZONTXpJPR1CoglJJC/wPq8k=; b=YXB+QiYmIkOWDSKsU89RJM7VizKXnak8Xj0VHpUahKVLd93lsknlBfAl2nvldFiLo6 SXNkk+RCoTdwObZyd+Fms6xsg7eDWi7/C1Hg8QGeqdkSPah/W16AOms9N7FAVoGGrZ+g cHEIgqizNJ9mbYPJb/mIKumv1vZdQWyr9/kk4xGH2MVo8MKcPlXi7pxvvU8wD9l810fy L2tGD7ahdU3q34FFcJ1xDeL+sVzKCP2PJPn88W1uUhZm0OUHDeGzM1PDv9DGMHUA+X6r EUtocuGTP2mECmWK1mLFiPJw/fj77qjcK3vg9hyPg4rGBY3jAB7ZfraUzr/rBAdrfd3m Q0Ow== X-Gm-Message-State: AOAM531fVk1SwBwiUftDpuOraFfd0QMB472vPv9lyrloMupaTNB0UBkl UZlkVojUw/qToRCPNAdEnoA= X-Google-Smtp-Source: ABdhPJwoq2qsFaiEymd9VtKA/KfinToQB4lR57IRZSQUfgM56wiNPmD3ejkwCoqptqwS60NyFZKvAw== X-Received: by 2002:a17:902:d113:b029:e2:86e9:c1ee with SMTP id w19-20020a170902d113b02900e286e9c1eemr19907015plw.42.1613485110617; Tue, 16 Feb 2021 06:18:30 -0800 (PST) Received: from localhost (185.212.56.4.16clouds.com. [185.212.56.4]) by smtp.gmail.com with ESMTPSA id m12sm3065459pjk.47.2021.02.16.06.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 06:18:30 -0800 (PST) From: Dejin Zheng To: corbet@lwn.net, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, rric@kernel.org, bhelgaas@google.com, wsa@kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, kw@linux.com Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH v2 2/4] Documentation: devres: Add pcim_alloc_irq_vectors() Date: Tue, 16 Feb 2021 22:18:08 +0800 Message-Id: <20210216141810.747678-3-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20210216141810.747678-1-zhengdejin5@gmail.com> References: <20210216141810.747678-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Add pcim_alloc_irq_vectors(), a device-managed version of pci_alloc_irq_vectors(). introducing this function can simplify the error handling path in many drivers. Signed-off-by: Dejin Zheng --- v1 -> v2: - Modify some commit messages. Documentation/driver-api/driver-model/devres.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst index cd8b6e657b94..a52f65b6352f 100644 --- a/Documentation/driver-api/driver-model/devres.rst +++ b/Documentation/driver-api/driver-model/devres.rst @@ -380,6 +380,7 @@ PCI devm_pci_alloc_host_bridge() : managed PCI host bridge allocation devm_pci_remap_cfgspace() : ioremap PCI configuration space devm_pci_remap_cfg_resource() : ioremap PCI configuration space resource + pcim_alloc_irq_vectors() : managed IRQ vectors allocation pcim_enable_device() : after success, all PCI ops become managed pcim_pin_device() : keep PCI device enabled after release From patchwork Tue Feb 16 14:18:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dejin Zheng X-Patchwork-Id: 12090061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5126FC433E0 for ; Tue, 16 Feb 2021 14:19:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C3A164E02 for ; Tue, 16 Feb 2021 14:19:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230170AbhBPOTT (ORCPT ); Tue, 16 Feb 2021 09:19:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbhBPOTP (ORCPT ); Tue, 16 Feb 2021 09:19:15 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 417F4C0613D6; Tue, 16 Feb 2021 06:18:35 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id f8so3965710plg.5; Tue, 16 Feb 2021 06:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IHEaF+WKHnNn5hB+4HbszzyQ9PkeVdXzN3dgFBMQEXo=; b=ef11sgnV/UXxKFcVgxGvL7LE+NNwCeOupgSes75/fQnxnyRpNSNVoVTZcTRKzO7VNS 21+ceS3lkMHQjQUEvI8Tpongs/ZGl+IyCKXgUJkm8XvX+TF3nRsoYWzcFT61AUFTqfXv wwJOHh9wCUBmLCE1OudnQ+N4uVJfkFcv9q+KRxBkn9j9odn6Dv7Gep12w6VMqg4Hkpu9 qqC92aH12QTGiiW7/Q+1VoWW8CB0w+8k9UiHaFFobTk+H5molyMJTXNLB/ZzBwLNx4lT xHF3iSS7FyVt+Chq4GWgsXsc0p0yFJts5HECHbYlZZbZhPVEHapEnnYl79K8HUvX0Lf2 YclA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IHEaF+WKHnNn5hB+4HbszzyQ9PkeVdXzN3dgFBMQEXo=; b=uBWez7qhPWWQDd3QuVrm2e944SM7xoVqv7dGiBfGQWdClWKD+mSMRk5MsUKQfcfgvK r0wAEP60oMfs2yo2Kv8+sgiQzBCRlV6NYkakorfGwoJq0gTlVhgnOUWzMil6GVw6J1me gNj9b0cKoLuWhuwUCW94dQymxjpiMT7/LePLBVR35pqTQ/1qfnw0C4tKngnYLwXfOUgH jiDWeftYTEvFtygoJGkRgu3hI+k3BYfyONrJvaAALXb/PpoREpIPidUqYJV0Y8x6wTbu 5hZ+pxO/ajKBNKXn2r6MpdhyyLfJmax0IzU21unxxpIf1z9M9TV0U/Bv8jdbd0GiGdb1 IbrA== X-Gm-Message-State: AOAM53346V09c3prgPJrrbibSt6vZYyro2t6vog1AlxNoOxHyKKExWG/ Ip2JdVq5llA9c4eiixItqVk= X-Google-Smtp-Source: ABdhPJxxmC4O0TZ9mAkEa2i7E+Zrav+9n9oUbTjSNFyTJ6otdgU55STJt4ylH9qnQ28oPxSKXGky1Q== X-Received: by 2002:a17:90a:2c9:: with SMTP id d9mr4479856pjd.67.1613485114854; Tue, 16 Feb 2021 06:18:34 -0800 (PST) Received: from localhost (185.212.56.4.16clouds.com. [185.212.56.4]) by smtp.gmail.com with ESMTPSA id y8sm23911377pfe.36.2021.02.16.06.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 06:18:34 -0800 (PST) From: Dejin Zheng To: corbet@lwn.net, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, rric@kernel.org, bhelgaas@google.com, wsa@kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, kw@linux.com Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH v2 3/4] i2c: designware: Use the correct name of device-managed function Date: Tue, 16 Feb 2021 22:18:09 +0800 Message-Id: <20210216141810.747678-4-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20210216141810.747678-1-zhengdejin5@gmail.com> References: <20210216141810.747678-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use the new function pcim_alloc_irq_vectors() to allocate IRQ vectors, the pcim_alloc_irq_vectors() function, an explicit device-managed version of pci_alloc_irq_vectors(). If pcim_enable_device() has been called before, then pci_alloc_irq_vectors() is actually a device-managed function. It is used here as a device-managed function, So replace it with pcim_alloc_irq_vectors(). Signed-off-by: Dejin Zheng --- v1 -> v2: - Modify some commit messages. drivers/i2c/busses/i2c-designware-pcidrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 55c83a7a24f3..444533be49ee 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -219,7 +219,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev, if (!dev) return -ENOMEM; - r = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); + r = pcim_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); if (r < 0) return r; From patchwork Tue Feb 16 14:18:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dejin Zheng X-Patchwork-Id: 12090063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A58AC433E6 for ; Tue, 16 Feb 2021 14:19:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6BFA64E2B for ; Tue, 16 Feb 2021 14:19:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230038AbhBPOTz (ORCPT ); Tue, 16 Feb 2021 09:19:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229924AbhBPOTm (ORCPT ); Tue, 16 Feb 2021 09:19:42 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77322C061788; Tue, 16 Feb 2021 06:18:46 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id z15so6221295pfc.3; Tue, 16 Feb 2021 06:18:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/buNpyRFgspwU+MkC/Juop3a8WJIqyKWAqKUWxoeJJc=; b=bX6jvJ3UlhD7THO1NdxMHfvVVKKqD2xJWU78jPT3XqLEKcN9VAX88Hw9VOy4mtxRZx jXxNItzb4CCeOlSM44taKtbCJPQ8LO2CY9Y6Ifyk/Oo28tW6n74FLFiaQFcTBkbvvFK1 ncYhQXjcnb6Yl+XWz8MGMJnRMyLLu3YawLZA2kHhDrJGt1BCjToBn6sh0veMR8tnIcz0 OumaY0jhqiKY8qR2CQJz/FYzjN+7wtNX08ZOL9FvYzFr7tSSLL8DPG2eNhKhSdCRPbRY lmL5PVNWP51e927eOk4RFkTVo4v06kBL0bXyJLueVN6TgnNuzAkzkgo+aNIAk604AosT 6//A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/buNpyRFgspwU+MkC/Juop3a8WJIqyKWAqKUWxoeJJc=; b=iUyLnVaER0muzwLQWSc9nBdUEuKOpsMHNDKPdsTeXy0rFyx0+kIweMuMSaCUGQL/RM eC8gr43fBw8656ef0K+u3m9GA/bL3EBvKtHkMrHr3MFK2zmREkvFBobPjGyHimdRRjz5 ElBCIrhz1JxKtlQfSaRj7J5qOeIUzP+ChHGsFhCAH9PPFMMBr8RDidpWdEbCEB+cBvdH yTHlgSY+9SVXEAizFbrvwM4qXT2wqPf/GQ+tLvCFHu+Qx4nFKEfIiKM6t1Pd9bdV+rin gyqxGAvRLQCIrFwQKqOY+5TlhJ8IoG8XLUswgZyyN9dvCBO8HUS53VSmjTky5Q/n8ic0 /Qog== X-Gm-Message-State: AOAM531B7tT8vLw1+BxJjyk+6orI0DH0WX7OvgX3KgFzeRLm9Q6xDXEv xkidMOK+DJ34N8rAzJJkPwE= X-Google-Smtp-Source: ABdhPJwcy1a0lBl8fNv+FAEpQDdRc5ILxMOYUdvTw8x/8rpkkxifobP8+A7Zgpl+flvdAQSzRb8ong== X-Received: by 2002:a63:234f:: with SMTP id u15mr19541929pgm.360.1613485126111; Tue, 16 Feb 2021 06:18:46 -0800 (PST) Received: from localhost (185.212.56.4.16clouds.com. [185.212.56.4]) by smtp.gmail.com with ESMTPSA id c26sm11189077pfj.183.2021.02.16.06.18.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 06:18:45 -0800 (PST) From: Dejin Zheng To: corbet@lwn.net, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, rric@kernel.org, bhelgaas@google.com, wsa@kernel.org, linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, kw@linux.com Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH v2 4/4] i2c: thunderx: Use the correct name of device-managed function Date: Tue, 16 Feb 2021 22:18:10 +0800 Message-Id: <20210216141810.747678-5-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20210216141810.747678-1-zhengdejin5@gmail.com> References: <20210216141810.747678-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use the new function pcim_alloc_irq_vectors() to allocate IRQ vectors, the pcim_alloc_irq_vectors() function, an explicit device-managed version of pci_alloc_irq_vectors(). If pcim_enable_device() has been called before, then pci_alloc_irq_vectors() is actually a device-managed function. It is used here as a device-managed function, So replace it with pcim_alloc_irq_vectors(). Signed-off-by: Dejin Zheng --- v1 -> v2: - Modify some commit messages. drivers/i2c/busses/i2c-thunderx-pcidrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c index 12c90aa0900e..63354e9fb726 100644 --- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c +++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c @@ -192,7 +192,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev, i2c->hlc_int_enable = thunder_i2c_hlc_int_enable; i2c->hlc_int_disable = thunder_i2c_hlc_int_disable; - ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX); + ret = pcim_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX); if (ret < 0) goto error;