@@ -1774,6 +1774,7 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, unsigned int blk_
1774
1774
1775
1775
/* "event_list" sysfs to list events supported by the block */
1776
1776
attr = & pmc -> block [blk_num ].attr_event_list ;
1777
+ sysfs_attr_init (& attr -> dev_attr .attr );
1777
1778
attr -> dev_attr .attr .mode = 0444 ;
1778
1779
attr -> dev_attr .show = mlxbf_pmc_event_list_show ;
1779
1780
attr -> nr = blk_num ;
@@ -1787,6 +1788,7 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, unsigned int blk_
1787
1788
if (strstr (pmc -> block_name [blk_num ], "l3cache" ) ||
1788
1789
((pmc -> block [blk_num ].type == MLXBF_PMC_TYPE_CRSPACE ))) {
1789
1790
attr = & pmc -> block [blk_num ].attr_enable ;
1791
+ sysfs_attr_init (& attr -> dev_attr .attr );
1790
1792
attr -> dev_attr .attr .mode = 0644 ;
1791
1793
attr -> dev_attr .show = mlxbf_pmc_enable_show ;
1792
1794
attr -> dev_attr .store = mlxbf_pmc_enable_store ;
@@ -1814,6 +1816,7 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, unsigned int blk_
1814
1816
/* "eventX" and "counterX" sysfs to program and read counter values */
1815
1817
for (j = 0 ; j < pmc -> block [blk_num ].counters ; ++ j ) {
1816
1818
attr = & pmc -> block [blk_num ].attr_counter [j ];
1819
+ sysfs_attr_init (& attr -> dev_attr .attr );
1817
1820
attr -> dev_attr .attr .mode = 0644 ;
1818
1821
attr -> dev_attr .show = mlxbf_pmc_counter_show ;
1819
1822
attr -> dev_attr .store = mlxbf_pmc_counter_store ;
@@ -1826,6 +1829,7 @@ static int mlxbf_pmc_init_perftype_counter(struct device *dev, unsigned int blk_
1826
1829
attr = NULL ;
1827
1830
1828
1831
attr = & pmc -> block [blk_num ].attr_event [j ];
1832
+ sysfs_attr_init (& attr -> dev_attr .attr );
1829
1833
attr -> dev_attr .attr .mode = 0644 ;
1830
1834
attr -> dev_attr .show = mlxbf_pmc_event_show ;
1831
1835
attr -> dev_attr .store = mlxbf_pmc_event_store ;
@@ -1861,6 +1865,7 @@ static int mlxbf_pmc_init_perftype_reg(struct device *dev, unsigned int blk_num)
1861
1865
while (count > 0 ) {
1862
1866
-- count ;
1863
1867
attr = & pmc -> block [blk_num ].attr_event [count ];
1868
+ sysfs_attr_init (& attr -> dev_attr .attr );
1864
1869
attr -> dev_attr .attr .mode = 0644 ;
1865
1870
attr -> dev_attr .show = mlxbf_pmc_counter_show ;
1866
1871
attr -> dev_attr .store = mlxbf_pmc_counter_store ;
0 commit comments