Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ehea: Use DEVICE_ATTR_*() macro

Use DEVICE_ATTR_*() helper instead of plain DEVICE_ATTR,
which makes the code a bit shorter and easier to read.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

YueHaibing and committed by
David S. Miller
0056982f 4934fb7d

+9 -9
+9 -9
drivers/net/ethernet/ibm/ehea/ehea_main.c
··· 2867 2867 return ret; 2868 2868 } 2869 2869 2870 - static ssize_t ehea_show_port_id(struct device *dev, 2871 - struct device_attribute *attr, char *buf) 2870 + static ssize_t log_port_id_show(struct device *dev, 2871 + struct device_attribute *attr, char *buf) 2872 2872 { 2873 2873 struct ehea_port *port = container_of(dev, struct ehea_port, ofdev.dev); 2874 2874 return sprintf(buf, "%d", port->logical_port_id); 2875 2875 } 2876 2876 2877 - static DEVICE_ATTR(log_port_id, 0444, ehea_show_port_id, NULL); 2877 + static DEVICE_ATTR_RO(log_port_id); 2878 2878 2879 2879 static void logical_port_release(struct device *dev) 2880 2880 { ··· 3113 3113 return NULL; 3114 3114 } 3115 3115 3116 - static ssize_t ehea_probe_port(struct device *dev, 3116 + static ssize_t probe_port_store(struct device *dev, 3117 3117 struct device_attribute *attr, 3118 3118 const char *buf, size_t count) 3119 3119 { ··· 3168 3168 return (ssize_t) count; 3169 3169 } 3170 3170 3171 - static ssize_t ehea_remove_port(struct device *dev, 3172 - struct device_attribute *attr, 3173 - const char *buf, size_t count) 3171 + static ssize_t remove_port_store(struct device *dev, 3172 + struct device_attribute *attr, 3173 + const char *buf, size_t count) 3174 3174 { 3175 3175 struct ehea_adapter *adapter = dev_get_drvdata(dev); 3176 3176 struct ehea_port *port; ··· 3203 3203 return (ssize_t) count; 3204 3204 } 3205 3205 3206 - static DEVICE_ATTR(probe_port, 0200, NULL, ehea_probe_port); 3207 - static DEVICE_ATTR(remove_port, 0200, NULL, ehea_remove_port); 3206 + static DEVICE_ATTR_WO(probe_port); 3207 + static DEVICE_ATTR_WO(remove_port); 3208 3208 3209 3209 static int ehea_create_device_sysfs(struct platform_device *dev) 3210 3210 {