linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Lu Baolu <baolu.lu@linux.intel.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	David Woodhouse <dwmw2@infradead.org>,
	iommu@lists.linux.dev, Joerg Roedel <joro@8bytes.org>,
	Len Brown <lenb@kernel.org>,
	linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Will Deacon <will@kernel.org>
Cc: Kevin Tian <kevin.tian@intel.com>, Nicolin Chen <nicolinc@nvidia.com>
Subject: [PATCH 02/11] iommu: Use iommu_group_ref_get/put() for dev->iommu_group
Date: Wed, 19 Apr 2023 13:11:48 -0300	[thread overview]
Message-ID: <2-v1-8aecc628b904+2f42-iommu_probe_jgg@nvidia.com> (raw)
In-Reply-To: <0-v1-8aecc628b904+2f42-iommu_probe_jgg@nvidia.com>

No reason to open code this, use the proper helper functions.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
 drivers/iommu/iommu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index c486e648402d5c..73e9f50fba9dd2 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -496,7 +496,7 @@ static void __iommu_group_release_device(struct iommu_group *group,
 	kfree(grp_dev->name);
 	kfree(grp_dev);
 	dev->iommu_group = NULL;
-	kobject_put(group->devices_kobj);
+	iommu_group_put(group);
 }
 
 static void iommu_release_device(struct device *dev)
@@ -1063,8 +1063,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
 		goto err_free_name;
 	}
 
-	kobject_get(group->devices_kobj);
-
+	iommu_group_ref_get(group);
 	dev->iommu_group = group;
 
 	mutex_lock(&group->mutex);
-- 
2.40.0


  parent reply	other threads:[~2023-04-19 16:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19 16:11 [PATCH 00/11] Consolidate the probe_device path Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 01/11] iommu: Have __iommu_probe_device() check for already probed devices Jason Gunthorpe
2023-04-26  9:12   ` Tian, Kevin
2023-04-19 16:11 ` Jason Gunthorpe [this message]
2023-04-26  9:12   ` [PATCH 02/11] iommu: Use iommu_group_ref_get/put() for dev->iommu_group Tian, Kevin
2023-04-19 16:11 ` [PATCH 03/11] iommu: Inline iommu_group_get_for_dev() into __iommu_probe_device() Jason Gunthorpe
2023-04-26  9:21   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 04/11] iommu: Simplify the __iommu_group_remove_device() flow Jason Gunthorpe
2023-04-26  9:21   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 05/11] iommu: Add iommu_init/deinit_driver() paired functions Jason Gunthorpe
2023-04-26  9:41   ` Tian, Kevin
2023-04-26 14:36     ` Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 06/11] iommu: Move the iommu driver sysfs setup into iommu_init/deinit_driver() Jason Gunthorpe
2023-04-26  9:41   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 07/11] iommu: Do not export iommu_device_link/unlink() Jason Gunthorpe
2023-04-26  9:42   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 08/11] iommu: Always destroy the iommu_group during iommu_release_device() Jason Gunthorpe
2023-04-20  4:23   ` Baolu Lu
2023-04-26 13:47     ` Jason Gunthorpe
2023-04-26  9:42   ` Tian, Kevin
2023-04-19 16:11 ` [PATCH 09/11] iommu/power: Remove iommu_del_device() Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 10/11] iommu: Split iommu_group_add_device() Jason Gunthorpe
2023-04-20  4:25   ` Baolu Lu
2023-04-20 13:09     ` Jason Gunthorpe
2023-04-19 16:11 ` [PATCH 11/11] iommu: Avoid locking/unlocking for iommu_probe_device() Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2-v1-8aecc628b904+2f42-iommu_probe_jgg@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nicolinc@nvidia.com \
    --cc=npiggin@gmail.com \
    --cc=rafael@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).