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

USB: atm: fix up some remaining DEVICE_ATTR() usage

There's no need to have DEVICE_ATTR() in these crazy macros, so use the
proper DEVICE_ATTR_*() versions intead.

Cc: Matthieu CASTET <castet.matthieu@free.fr>
Cc: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+10 -12
+8 -10
drivers/usb/atm/cxacru.c
··· 196 196 197 197 /* Card info exported through sysfs */ 198 198 #define CXACRU__ATTR_INIT(_name) \ 199 - static DEVICE_ATTR(_name, S_IRUGO, cxacru_sysfs_show_##_name, NULL) 199 + static DEVICE_ATTR_RO(_name) 200 200 201 201 #define CXACRU_CMD_INIT(_name) \ 202 - static DEVICE_ATTR(_name, S_IWUSR | S_IRUGO, \ 203 - cxacru_sysfs_show_##_name, cxacru_sysfs_store_##_name) 202 + static DEVICE_ATTR_RW(_name) 204 203 205 204 #define CXACRU_SET_INIT(_name) \ 206 - static DEVICE_ATTR(_name, S_IWUSR, \ 207 - NULL, cxacru_sysfs_store_##_name) 205 + static DEVICE_ATTR_WO(_name) 208 206 209 207 #define CXACRU_ATTR_INIT(_value, _type, _name) \ 210 - static ssize_t cxacru_sysfs_show_##_name(struct device *dev, \ 208 + static ssize_t _name##_show(struct device *dev, \ 211 209 struct device_attribute *attr, char *buf) \ 212 210 { \ 213 211 struct cxacru_data *instance = to_usbatm_driver_data(\ ··· 300 302 * MAC_ADDRESS_LOW = 0x33221100 301 303 * Where 00-55 are bytes 0-5 of the MAC. 302 304 */ 303 - static ssize_t cxacru_sysfs_show_mac_address(struct device *dev, 305 + static ssize_t mac_address_show(struct device *dev, 304 306 struct device_attribute *attr, char *buf) 305 307 { 306 308 struct cxacru_data *instance = to_usbatm_driver_data( ··· 313 315 instance->usbatm->atm_dev->esi); 314 316 } 315 317 316 - static ssize_t cxacru_sysfs_show_adsl_state(struct device *dev, 318 + static ssize_t adsl_state_show(struct device *dev, 317 319 struct device_attribute *attr, char *buf) 318 320 { 319 321 static char *str[] = { "running", "stopped" }; ··· 330 332 return snprintf(buf, PAGE_SIZE, "%s\n", str[value]); 331 333 } 332 334 333 - static ssize_t cxacru_sysfs_store_adsl_state(struct device *dev, 335 + static ssize_t adsl_state_store(struct device *dev, 334 336 struct device_attribute *attr, const char *buf, size_t count) 335 337 { 336 338 struct cxacru_data *instance = to_usbatm_driver_data( ··· 433 435 434 436 /* CM_REQUEST_CARD_DATA_GET times out, so no show attribute */ 435 437 436 - static ssize_t cxacru_sysfs_store_adsl_config(struct device *dev, 438 + static ssize_t adsl_config_store(struct device *dev, 437 439 struct device_attribute *attr, const char *buf, size_t count) 438 440 { 439 441 struct cxacru_data *instance = to_usbatm_driver_data(
+2 -2
drivers/usb/atm/ueagle-atm.c
··· 2412 2412 2413 2413 #define UEA_ATTR(name, reset) \ 2414 2414 \ 2415 - static ssize_t read_##name(struct device *dev, \ 2415 + static ssize_t stat_##name##_show(struct device *dev, \ 2416 2416 struct device_attribute *attr, char *buf) \ 2417 2417 { \ 2418 2418 int ret = -ENODEV; \ ··· 2430 2430 return ret; \ 2431 2431 } \ 2432 2432 \ 2433 - static DEVICE_ATTR(stat_##name, S_IRUGO, read_##name, NULL) 2433 + static DEVICE_ATTR_RO(stat_##name) 2434 2434 2435 2435 UEA_ATTR(mflags, 1); 2436 2436 UEA_ATTR(vidcpe, 0);