staging: gasket: apex: fix sysfs_show

sysfs_show was incorrectly extracting the sysfs_attribute_type from the
gasket_sysfs_attribute. This prevented dispatch from working properly.

Change-Id: Ib962a10cf24bd4be416708e0a6294b6db431c76f
Signed-off-by: Nick Ewalt <nicholasewalt@google.com>
This commit is contained in:
Nick Ewalt
2018-09-25 09:52:02 -07:00
committed by Leonid Lobachev
parent 641f4139f4
commit 068cb76fc5
2 changed files with 3 additions and 3 deletions

View File

@@ -584,7 +584,7 @@ static ssize_t sysfs_show(struct device *device, struct device_attribute *attr,
return -ENODEV; return -ENODEV;
} }
type = (enum sysfs_attribute_type)gasket_sysfs_get_attr(device, attr); type = (enum sysfs_attribute_type)gasket_attr->data.attr_type;
switch (type) { switch (type) {
case ATTR_KERNEL_HIB_PAGE_TABLE_SIZE: case ATTR_KERNEL_HIB_PAGE_TABLE_SIZE:
ret = scnprintf(buf, PAGE_SIZE, "%u\n", ret = scnprintf(buf, PAGE_SIZE, "%u\n",

View File

@@ -152,8 +152,8 @@ void gasket_sysfs_put_device_data(struct device *device,
* Returns the Gasket sysfs attribute associated with the kernel device * Returns the Gasket sysfs attribute associated with the kernel device
* attribute and device structure itself. Upon success, this call will take a * attribute and device structure itself. Upon success, this call will take a
* reference to internal sysfs data that must be released with a call to * reference to internal sysfs data that must be released with a call to
* gasket_sysfs_get_device_data. While this reference is held, the underlying * gasket_sysfs_put_attr. While this reference is held, the underlying device
* device sysfs information/structure will remain valid/will not be deleted. * sysfs information/structure will remain valid/will not be deleted.
*/ */
struct gasket_sysfs_attribute * struct gasket_sysfs_attribute *
gasket_sysfs_get_attr(struct device *device, struct device_attribute *attr); gasket_sysfs_get_attr(struct device *device, struct device_attribute *attr);