diff options
| author | Peter Zijlstra <[email protected]> | 2016-11-14 16:29:48 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2017-01-14 10:37:18 +0000 |
| commit | 2c935bc57221cc2edc787c72ea0e2d30cdcd3d5e (patch) | |
| tree | 4ccb975ac9142887b4e7e7bf1c0cca5c53d4cf99 /drivers/pci/hotplug/pnv_php.c | |
| parent | locking/atomic, kref: Add KREF_INIT() (diff) | |
| download | kernel-2c935bc57221cc2edc787c72ea0e2d30cdcd3d5e.tar.gz kernel-2c935bc57221cc2edc787c72ea0e2d30cdcd3d5e.zip | |
locking/atomic, kref: Add kref_read()
Since we need to change the implementation, stop exposing internals.
Provide kref_read() to read the current reference count; typically
used for debug messages.
Kills two anti-patterns:
atomic_read(&kref->refcount)
kref->refcount.counter
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'drivers/pci/hotplug/pnv_php.c')
| -rw-r--r-- | drivers/pci/hotplug/pnv_php.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 56efaf72d08e..d2961ef39a3a 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -155,7 +155,7 @@ static void pnv_php_detach_device_nodes(struct device_node *parent) pnv_php_detach_device_nodes(dn); of_node_put(dn); - refcount = atomic_read(&dn->kobj.kref.refcount); + refcount = kref_read(&dn->kobj.kref); if (refcount != 1) pr_warn("Invalid refcount %d on <%s>\n", refcount, of_node_full_name(dn)); |
