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

can: softing: drop 'channel' sysfs attribute

netdev->dev_id obsoletes this property.
None of the remaining properties contribute to udev detection methods.
The regular calls for the sysfs group can thus safely be restored.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Kurt Van Dijck and committed by
Marc Kleine-Budde
ec2e11ed abcd7f75

+4 -12
+4 -12
drivers/net/can/softing/softing_main.c
··· 556 556 /* 557 557 * netdev sysfs 558 558 */ 559 - static ssize_t show_channel(struct device *dev, struct device_attribute *attr, 560 - char *buf) 561 - { 562 - struct net_device *ndev = to_net_dev(dev); 563 - struct softing_priv *priv = netdev2softing(ndev); 564 - 565 - return sprintf(buf, "%i\n", priv->index); 566 - } 567 - 568 559 static ssize_t show_chip(struct device *dev, struct device_attribute *attr, 569 560 char *buf) 570 561 { ··· 600 609 return count; 601 610 } 602 611 603 - static const DEVICE_ATTR(channel, S_IRUGO, show_channel, NULL); 604 612 static const DEVICE_ATTR(chip, S_IRUGO, show_chip, NULL); 605 613 static const DEVICE_ATTR(output, S_IRUGO | S_IWUSR, show_output, store_output); 606 614 607 615 static const struct attribute *const netdev_sysfs_attrs[] = { 608 - &dev_attr_channel.attr, 609 616 &dev_attr_chip.attr, 610 617 &dev_attr_output.attr, 611 618 NULL, ··· 668 679 { 669 680 int ret; 670 681 671 - netdev->sysfs_groups[0] = &netdev_sysfs_group; 672 682 ret = register_candev(netdev); 673 683 if (ret) { 674 684 dev_alert(&netdev->dev, "register failed\n"); 675 685 return ret; 676 686 } 687 + if (sysfs_create_group(&netdev->dev.kobj, &netdev_sysfs_group) < 0) 688 + netdev_alert(netdev, "sysfs group failed\n"); 689 + 677 690 return 0; 678 691 } 679 692 680 693 static void softing_netdev_cleanup(struct net_device *netdev) 681 694 { 695 + sysfs_remove_group(&netdev->dev.kobj, &netdev_sysfs_group); 682 696 unregister_candev(netdev); 683 697 free_candev(netdev); 684 698 }