Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1317213pxb; Fri, 26 Feb 2021 07:53:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5d+F3E0DKRr1YaUdadKoE7dZeWlPx9CpYibBDGjDYrhNLSUkd0/oUk7f0PN/o/igeoLhg X-Received: by 2002:a05:6402:890:: with SMTP id e16mr4022636edy.335.1614354815899; Fri, 26 Feb 2021 07:53:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614354815; cv=none; d=google.com; s=arc-20160816; b=sIuApxug2h3zLC7xikaxzklNvIQTGwHoqwz6ZuSyt8z0GYU5oRCW6Rsd9IOk2Kythd CdZOc7bGNHL2dmn2L7pHTUk4HbnPAzzOjNKq7fi8cLTjqYCGWkB+jQ5VbCUwiHMxLuVW JeqMiJ2GmQQZLJ4OnmSBBGPaUwYACudKqZqlbES7eDqWjARKdxC17b3FXEkGu8YTjOKu CYUXa2IxBu7L6g5vnwNjM1hV/fS51ABnQjf4P7NJb4URKjwwHuecsCtvWwc0HNSUkzi2 fU/NFmWk+XfmvxT3Oot+TOK2a2KgIExr634R0JSRwkDRoKjSEsfhJIX9jAcnLcTDrZzk 2Z5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ktT+GdjKKyhRnZ7kpXgzw67KpCbIpEYpAT6oM+VedEY=; b=dWBCRvUcT9YMnb5h973q8uDhU0a7xtwruH7kVvFjysolfuuCqDBCsLr90f/ViJBrRE hjpgnMa8fVEeZplCFPUw/2JJWVdtu/F8GHghpmENuQcWf4unjpD2pN4jqvvV2RZqPSNh mYIK08w8VjUUbq9ATbEZMtrWL8Qh8ZmyFZT4aKCi6STuzunkN9mzPX75Fv+vllAbLiPa 1+kf2KS/K4JhFPCW2o4Vl3v2ADfbEE86t1Nc58536XX9ABnPkyHdhldiQIMLF2brEnuM P+ZE3js+fLyZVhYiJLv8brXf8yC9LI9ZST+cNseHH8Iy4w2yUErZCrXSdp1/PmTZGPX6 G5DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fHgyPyB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f12si5956109edd.7.2021.02.26.07.53.12; Fri, 26 Feb 2021 07:53:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fHgyPyB9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbhBZPvs (ORCPT + 99 others); Fri, 26 Feb 2021 10:51:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbhBZPvr (ORCPT ); Fri, 26 Feb 2021 10:51:47 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDCB9C06174A; Fri, 26 Feb 2021 07:51:03 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id g20so5519646plo.2; Fri, 26 Feb 2021 07:51:03 -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:mime-version :content-transfer-encoding; bh=ktT+GdjKKyhRnZ7kpXgzw67KpCbIpEYpAT6oM+VedEY=; b=fHgyPyB96G0xA0bQbvkeXRwcSfe6c8XVo/mlI4Kemqq4FNnAUU+IUcRsVmHbSrS5ny AwedSc9S8V2RRlSrRghYX4gCWKmYBGyIvT/9QcdAM0nfkhaca+ImPuctX7G1i1Euiiql 23mtqXVkIUeqv8pt3MqDctEw7q7LaCFO18dAqYEfY2EmHcH8zt6P3hkUT09hHA9/JVSw kWINUz9iGcLJ5vpQzA0PTOr1vbbvkCm+K/DZmefv64A0WaIyrCFQGhFzzX0er82wPDaP uMCA0CivbUFJf/Ftz7iwZI0ZHwCxq4j/10K46//QE6JYfX3Mjibhq0o7dsV4cEPr7nRV L4gg== 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:mime-version :content-transfer-encoding; bh=ktT+GdjKKyhRnZ7kpXgzw67KpCbIpEYpAT6oM+VedEY=; b=S2p+Pqs6inFasWb2QWYe1BE3E338gsyBJMdjveVQ5ndge0rZ/2YVMUdBWs/1TFeeAN A1BcmlCnlqPEcMkCNC2a4F/uVdjnbYouOtxH5n/WB4+NtpNUJ0DtFG6uuazRcRi7C/eh 84iB8yLpgK7UoYDZaWoKbyJkmDAMvJ0P01pvPdzIvz3rjPwlzLpGLDPt0PQixCvcAA4W g92Lpx+MKwRp7HTn+QJO3m8jPt5RR3vSDLSruKLyt2F/OqRyI9lnwPrCCwwxK2ZAL94X atRiPPi2N5H9mgSHxSpH2WSo5IVsq0uxImWlIkKmoSBv+8vC2L7baH/N7Da2dg99Z+wG HXhw== X-Gm-Message-State: AOAM531AfCzjaZCSEMraOGyiDVDwr+NSWNo2Z8qtw/puNCxd69k5a300 gLAU65C0HkwSlu+bzB6qU4M2GmlQq/f5PQ== X-Received: by 2002:a17:90a:4611:: with SMTP id w17mr4257481pjg.122.1614354663524; Fri, 26 Feb 2021 07:51:03 -0800 (PST) Received: from localhost (89.208.244.53.16clouds.com. [89.208.244.53]) by smtp.gmail.com with ESMTPSA id n11sm9157293pgm.30.2021.02.26.07.51.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 07:51:03 -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 Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH v5 0/4] Introduce pcim_alloc_irq_vectors() Date: Fri, 26 Feb 2021 23:50:52 +0800 Message-Id: <20210226155056.1068534-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce pcim_alloc_irq_vectors(), a device-managed version of pci_alloc_irq_vectors(), In some i2c drivers, If pcim_enable_device() has been called before, then pci_alloc_irq_vectors() is actually a device-managed function. It is used as a device-managed function, So replace it with pcim_alloc_irq_vectors(). Changelog --------- v4 -> v5: - Remove the check of enable device in pcim_alloc_irq_vectors() and make it as a static line function. - Modify the subject name in patch 3 and patch 4. v3 -> v4: - add some commit comments for patch 3 v2 -> v3: - Add some commit comments for replace some codes in pcim_release() by pci_free_irq_vectors(). - Simplify the error handling path in i2c designware driver. v1 -> v2: - Use pci_free_irq_vectors() to replace some code in pcim_release(). - Modify some commit messages. Dejin Zheng (4): PCI: Introduce pcim_alloc_irq_vectors() Documentation: devres: Add pcim_alloc_irq_vectors() i2c: designware: Use pcim_alloc_irq_vectors() to allocate IRQ vectors i2c: thunderx: Use pcim_alloc_irq_vectors() to allocate IRQ vectors .../driver-api/driver-model/devres.rst | 1 + drivers/i2c/busses/i2c-designware-pcidrv.c | 15 ++++-------- drivers/i2c/busses/i2c-thunderx-pcidrv.c | 2 +- drivers/pci/pci.c | 5 +--- include/linux/pci.h | 24 +++++++++++++++++++ 5 files changed, 31 insertions(+), 16 deletions(-) -- 2.25.0