@@ -657,20 +657,11 @@ static ssize_t core_id_show(struct device *dev, struct device_attribute *attr,
657
657
658
658
static DEVICE_ATTR_RO (core_id );
659
659
660
- static int malidp_init_sysfs (struct device * dev )
661
- {
662
- int ret = device_create_file (dev , & dev_attr_core_id );
663
-
664
- if (ret )
665
- DRM_ERROR ("failed to create device file for core_id\n" );
666
-
667
- return ret ;
668
- }
669
-
670
- static void malidp_fini_sysfs (struct device * dev )
671
- {
672
- device_remove_file (dev , & dev_attr_core_id );
673
- }
660
+ static struct attribute * mali_dp_attrs [] = {
661
+ & dev_attr_core_id .attr ,
662
+ NULL ,
663
+ };
664
+ ATTRIBUTE_GROUPS (mali_dp );
674
665
675
666
#define MAX_OUTPUT_CHANNELS 3
676
667
@@ -832,10 +823,6 @@ static int malidp_bind(struct device *dev)
832
823
if (ret < 0 )
833
824
goto query_hw_fail ;
834
825
835
- ret = malidp_init_sysfs (dev );
836
- if (ret )
837
- goto init_fail ;
838
-
839
826
/* Set the CRTC's port so that the encoder component can find it */
840
827
malidp -> crtc .port = of_graph_get_port_by_id (dev -> of_node , 0 );
841
828
@@ -893,8 +880,6 @@ static int malidp_bind(struct device *dev)
893
880
bind_fail :
894
881
of_node_put (malidp -> crtc .port );
895
882
malidp -> crtc .port = NULL ;
896
- init_fail :
897
- malidp_fini_sysfs (dev );
898
883
malidp_fini (drm );
899
884
query_hw_fail :
900
885
pm_runtime_put (dev );
@@ -927,7 +912,6 @@ static void malidp_unbind(struct device *dev)
927
912
component_unbind_all (dev , drm );
928
913
of_node_put (malidp -> crtc .port );
929
914
malidp -> crtc .port = NULL ;
930
- malidp_fini_sysfs (dev );
931
915
malidp_fini (drm );
932
916
pm_runtime_put (dev );
933
917
if (pm_runtime_enabled (dev ))
@@ -1023,6 +1007,7 @@ static struct platform_driver malidp_platform_driver = {
1023
1007
.name = "mali-dp" ,
1024
1008
.pm = & malidp_pm_ops ,
1025
1009
.of_match_table = malidp_drm_of_match ,
1010
+ .dev_groups = mali_dp_groups ,
1026
1011
},
1027
1012
};
1028
1013
0 commit comments