hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAKLPG
---------------------------------------
There is no need to provide a extra state_show sysfs to query the hbm_cache state, we can use the "status" sysfs interface to query the hbm_cache state.
Signed-off-by: Zhang Zekun zhangzekun11@huawei.com --- drivers/soc/hisilicon/hisi_hbmcache.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/drivers/soc/hisilicon/hisi_hbmcache.c b/drivers/soc/hisilicon/hisi_hbmcache.c index 34121320742e..c3295a7919d1 100644 --- a/drivers/soc/hisilicon/hisi_hbmcache.c +++ b/drivers/soc/hisilicon/hisi_hbmcache.c @@ -38,25 +38,7 @@ static ssize_t state_store(struct device *d, struct device_attribute *attr,
return count; } - -static ssize_t state_show(struct device *d, struct device_attribute *attr, - char *buf) -{ - struct acpi_device *adev = ACPI_COMPANION(d); - unsigned long long sta = 0; - acpi_status status; - const char *output; - - status = acpi_evaluate_integer(adev->handle, "_STA", NULL, &sta); - if (ACPI_FAILURE(status)) - return -EINVAL; - - output = (sta & 0x01) ? online_type_to_str[STATE_ONLINE] : - online_type_to_str[STATE_OFFLINE]; - - return sysfs_emit(buf, "%s\n", output); -} -static DEVICE_ATTR_RW(state); +static DEVICE_ATTR_WO(state);
static ssize_t socket_id_show(struct device *d, struct device_attribute *attr, char *buf)