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

extcon: convert extcon_class to use dev_groups

The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the extcon_class code to use the
correct field.

Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Chanwoo Choi<cw00.choi@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+8 -5
+8 -5
drivers/extcon/extcon-class.c
··· 148 148 149 149 return count; 150 150 } 151 + static DEVICE_ATTR_RW(state); 151 152 152 153 static ssize_t name_show(struct device *dev, struct device_attribute *attr, 153 154 char *buf) ··· 164 163 165 164 return sprintf(buf, "%s\n", dev_name(edev->dev)); 166 165 } 166 + static DEVICE_ATTR_RO(name); 167 167 168 168 static ssize_t cable_name_show(struct device *dev, 169 169 struct device_attribute *attr, char *buf) ··· 529 527 } 530 528 EXPORT_SYMBOL_GPL(extcon_unregister_notifier); 531 529 532 - static struct device_attribute extcon_attrs[] = { 533 - __ATTR(state, S_IRUGO | S_IWUSR, state_show, state_store), 534 - __ATTR_RO(name), 535 - __ATTR_NULL, 530 + static struct attribute *extcon_attrs[] = { 531 + &dev_attr_state.attr, 532 + &dev_attr_name.attr, 533 + NULL, 536 534 }; 535 + ATTRIBUTE_GROUPS(extcon); 537 536 538 537 static int create_extcon_class(void) 539 538 { ··· 542 539 extcon_class = class_create(THIS_MODULE, "extcon"); 543 540 if (IS_ERR(extcon_class)) 544 541 return PTR_ERR(extcon_class); 545 - extcon_class->dev_attrs = extcon_attrs; 542 + extcon_class->dev_groups = extcon_groups; 546 543 547 544 #if defined(CONFIG_ANDROID) 548 545 switch_class = class_compat_register("switch");