File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
drivers/platform/mellanox Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1890,13 +1890,14 @@ static ssize_t mlxbf_pmc_enable_store(struct device *dev,
1890
1890
{
1891
1891
struct mlxbf_pmc_attribute * attr_enable = container_of (
1892
1892
attr , struct mlxbf_pmc_attribute , dev_attr );
1893
- unsigned int en , blk_num ;
1893
+ unsigned int blk_num ;
1894
1894
u32 word ;
1895
1895
int err ;
1896
+ bool en ;
1896
1897
1897
1898
blk_num = attr_enable -> nr ;
1898
1899
1899
- err = kstrtouint (buf , 0 , & en );
1900
+ err = kstrtobool (buf , & en );
1900
1901
if (err < 0 )
1901
1902
return err ;
1902
1903
@@ -1916,14 +1917,11 @@ static ssize_t mlxbf_pmc_enable_store(struct device *dev,
1916
1917
MLXBF_PMC_CRSPACE_PERFMON_CTL (pmc -> block [blk_num ].counters ),
1917
1918
MLXBF_PMC_WRITE_REG_32 , word );
1918
1919
} else {
1919
- if (en && en != 1 )
1920
- return - EINVAL ;
1921
-
1922
1920
err = mlxbf_pmc_config_l3_counters (blk_num , false, !!en );
1923
1921
if (err )
1924
1922
return err ;
1925
1923
1926
- if (en == 1 ) {
1924
+ if (en ) {
1927
1925
err = mlxbf_pmc_config_l3_counters (blk_num , true, false);
1928
1926
if (err )
1929
1927
return err ;
You can’t perform that action at this time.
0 commit comments