Commit 86f1ea9d authored by YueHaibing's avatar YueHaibing Committed by Kalle Valo
Browse files

wlcore: use DEVICE_ATTR_<RW|RO> macro



Use DEVICE_ATTR_<RW|RO> helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.

Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210523033538.25568-1-yuehaibing@huawei.com
parent 080f9c10
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
#include "debug.h"
#include "sysfs.h"

static ssize_t wl1271_sysfs_show_bt_coex_state(struct device *dev,
static ssize_t bt_coex_state_show(struct device *dev,
				  struct device_attribute *attr,
				  char *buf)
{
@@ -30,7 +30,7 @@ static ssize_t wl1271_sysfs_show_bt_coex_state(struct device *dev,

}

static ssize_t wl1271_sysfs_store_bt_coex_state(struct device *dev,
static ssize_t bt_coex_state_store(struct device *dev,
				   struct device_attribute *attr,
				   const char *buf, size_t count)
{
@@ -71,11 +71,9 @@ static ssize_t wl1271_sysfs_store_bt_coex_state(struct device *dev,
	return count;
}

static DEVICE_ATTR(bt_coex_state, 0644,
		   wl1271_sysfs_show_bt_coex_state,
		   wl1271_sysfs_store_bt_coex_state);
static DEVICE_ATTR_RW(bt_coex_state);

static ssize_t wl1271_sysfs_show_hw_pg_ver(struct device *dev,
static ssize_t hw_pg_ver_show(struct device *dev,
			      struct device_attribute *attr,
			      char *buf)
{
@@ -94,7 +92,7 @@ static ssize_t wl1271_sysfs_show_hw_pg_ver(struct device *dev,
	return len;
}

static DEVICE_ATTR(hw_pg_ver, 0444, wl1271_sysfs_show_hw_pg_ver, NULL);
static DEVICE_ATTR_RO(hw_pg_ver);

static ssize_t wl1271_sysfs_read_fwlog(struct file *filp, struct kobject *kobj,
				       struct bin_attribute *bin_attr,