Commit 4cc4dbbc authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman

drivers/staging/gasket: Use refcount_read()

Use the refcount_read accessor function, avoid reaching into refcount
and atomic struct fields.
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4031e6ca
...@@ -122,7 +122,7 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping) ...@@ -122,7 +122,7 @@ static void put_mapping(struct gasket_sysfs_mapping *mapping)
} }
mutex_lock(&mapping->mutex); 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!"); gasket_nodev_error("Refcount is already 0!");
if (kref_put(&mapping->refcount, release_entry)) { if (kref_put(&mapping->refcount, release_entry)) {
gasket_nodev_info("Removing Gasket sysfs mapping, device %s", gasket_nodev_info("Removing Gasket sysfs mapping, device %s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment