diff options
-rw-r--r-- | drivers/s390/char/vmlogrdr.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 524d988d89dd..e9d70aedbaa2 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c | |||
@@ -668,6 +668,13 @@ static struct attribute *vmlogrdr_attrs[] = { | |||
668 | &dev_attr_recording.attr, | 668 | &dev_attr_recording.attr, |
669 | NULL, | 669 | NULL, |
670 | }; | 670 | }; |
671 | static struct attribute_group vmlogrdr_attr_group = { | ||
672 | .attrs = vmlogrdr_attrs, | ||
673 | }; | ||
674 | static const struct attribute_group *vmlogrdr_attr_groups[] = { | ||
675 | &vmlogrdr_attr_group, | ||
676 | NULL, | ||
677 | }; | ||
671 | 678 | ||
672 | static int vmlogrdr_pm_prepare(struct device *dev) | 679 | static int vmlogrdr_pm_prepare(struct device *dev) |
673 | { | 680 | { |
@@ -692,10 +699,6 @@ static const struct dev_pm_ops vmlogrdr_pm_ops = { | |||
692 | .prepare = vmlogrdr_pm_prepare, | 699 | .prepare = vmlogrdr_pm_prepare, |
693 | }; | 700 | }; |
694 | 701 | ||
695 | static struct attribute_group vmlogrdr_attr_group = { | ||
696 | .attrs = vmlogrdr_attrs, | ||
697 | }; | ||
698 | |||
699 | static struct class *vmlogrdr_class; | 702 | static struct class *vmlogrdr_class; |
700 | static struct device_driver vmlogrdr_driver = { | 703 | static struct device_driver vmlogrdr_driver = { |
701 | .name = "vmlogrdr", | 704 | .name = "vmlogrdr", |
@@ -762,6 +765,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) | |||
762 | dev->bus = &iucv_bus; | 765 | dev->bus = &iucv_bus; |
763 | dev->parent = iucv_root; | 766 | dev->parent = iucv_root; |
764 | dev->driver = &vmlogrdr_driver; | 767 | dev->driver = &vmlogrdr_driver; |
768 | dev->groups = vmlogrdr_attr_groups; | ||
765 | dev_set_drvdata(dev, priv); | 769 | dev_set_drvdata(dev, priv); |
766 | /* | 770 | /* |
767 | * The release function could be called after the | 771 | * The release function could be called after the |
@@ -779,11 +783,6 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) | |||
779 | return ret; | 783 | return ret; |
780 | } | 784 | } |
781 | 785 | ||
782 | ret = sysfs_create_group(&dev->kobj, &vmlogrdr_attr_group); | ||
783 | if (ret) { | ||
784 | device_unregister(dev); | ||
785 | return ret; | ||
786 | } | ||
787 | priv->class_device = device_create(vmlogrdr_class, dev, | 786 | priv->class_device = device_create(vmlogrdr_class, dev, |
788 | MKDEV(vmlogrdr_major, | 787 | MKDEV(vmlogrdr_major, |
789 | priv->minor_num), | 788 | priv->minor_num), |
@@ -791,7 +790,6 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) | |||
791 | if (IS_ERR(priv->class_device)) { | 790 | if (IS_ERR(priv->class_device)) { |
792 | ret = PTR_ERR(priv->class_device); | 791 | ret = PTR_ERR(priv->class_device); |
793 | priv->class_device=NULL; | 792 | priv->class_device=NULL; |
794 | sysfs_remove_group(&dev->kobj, &vmlogrdr_attr_group); | ||
795 | device_unregister(dev); | 793 | device_unregister(dev); |
796 | return ret; | 794 | return ret; |
797 | } | 795 | } |
@@ -804,7 +802,6 @@ static int vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv) | |||
804 | { | 802 | { |
805 | device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num)); | 803 | device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num)); |
806 | if (priv->device != NULL) { | 804 | if (priv->device != NULL) { |
807 | sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group); | ||
808 | device_unregister(priv->device); | 805 | device_unregister(priv->device); |
809 | priv->device=NULL; | 806 | priv->device=NULL; |
810 | } | 807 | } |