Skip to content

Commit ec2e11e

Browse files
kurt-vdmarckleinebudde
authored andcommitted
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>
1 parent abcd7f7 commit ec2e11e

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

‎drivers/net/can/softing/softing_main.c‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,6 @@ static int softing_card_boot(struct softing *card)
556556
/*
557557
* netdev sysfs
558558
*/
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-
568559
static ssize_t show_chip(struct device *dev, struct device_attribute *attr,
569560
char *buf)
570561
{
@@ -609,12 +600,10 @@ static ssize_t store_output(struct device *dev, struct device_attribute *attr,
609600
return count;
610601
}
611602

612-
static const DEVICE_ATTR(channel, S_IRUGO, show_channel, NULL);
613603
static const DEVICE_ATTR(chip, S_IRUGO, show_chip, NULL);
614604
static const DEVICE_ATTR(output, S_IRUGO | S_IWUSR, show_output, store_output);
615605

616606
static const struct attribute *const netdev_sysfs_attrs[] = {
617-
&dev_attr_channel.attr,
618607
&dev_attr_chip.attr,
619608
&dev_attr_output.attr,
620609
NULL,
@@ -679,17 +668,20 @@ static int softing_netdev_register(struct net_device *netdev)
679668
{
680669
int ret;
681670

682-
netdev->sysfs_groups[0] = &netdev_sysfs_group;
683671
ret = register_candev(netdev);
684672
if (ret) {
685673
dev_alert(&netdev->dev, "register failed\n");
686674
return ret;
687675
}
676+
if (sysfs_create_group(&netdev->dev.kobj, &netdev_sysfs_group) < 0)
677+
netdev_alert(netdev, "sysfs group failed\n");
678+
688679
return 0;
689680
}
690681

691682
static void softing_netdev_cleanup(struct net_device *netdev)
692683
{
684+
sysfs_remove_group(&netdev->dev.kobj, &netdev_sysfs_group);
693685
unregister_candev(netdev);
694686
free_candev(netdev);
695687
}

0 commit comments

Comments
 (0)