diff options
author | Todd Poynor <toddpoynor@google.com> | 2018-07-06 23:43:10 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-07 10:02:09 +0200 |
commit | 4cc4dbbc0946c31b0988bb44eea19d759b054351 (patch) | |
tree | e58c65d7e60cd7c59a0bf7995b9a1822b47f8609 /drivers | |
parent | staging: rtl8192u: Add space after ', ' character - Coding Style (diff) | |
download | linux-dev-4cc4dbbc0946c31b0988bb44eea19d759b054351.tar.xz linux-dev-4cc4dbbc0946c31b0988bb44eea19d759b054351.zip |
drivers/staging/gasket: Use refcount_read()
Use the refcount_read accessor function, avoid reaching into refcount
and atomic struct fields.
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/gasket/gasket_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/gasket/gasket_sysfs.c b/drivers/staging/gasket/gasket_sysfs.c index 40268fb50fc3..a3705d6e088a 100644 --- a/drivers/staging/gasket/gasket_sysfs.c +++ b/drivers/staging/gasket/gasket_sysfs.c @@ -122,7 +122,7 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping) } mutex_lock(&mapping->mutex); - if (mapping->refcount.refcount.refs.counter == 0) + if (refcount_read(&mapping->refcount.refcount) == 0) gasket_nodev_error("Refcount is already 0!"); if (kref_put(&mapping->refcount, release_entry)) { gasket_nodev_info("Removing Gasket sysfs mapping, device %s", |