@@ -191,18 +191,20 @@ static int xlat_nvdimm_status(struct nvdimm *nvdimm, void *buf, unsigned int cmd
191
191
* In the _LSI, _LSR, _LSW case the locked status is
192
192
* communicated via the read/write commands
193
193
*/
194
- if (nfit_mem -> has_lsr )
194
+ if (test_bit ( NFIT_MEM_LSR , & nfit_mem -> flags ) )
195
195
break ;
196
196
197
197
if (status >> 16 & ND_CONFIG_LOCKED )
198
198
return - EACCES ;
199
199
break ;
200
200
case ND_CMD_GET_CONFIG_DATA :
201
- if (nfit_mem -> has_lsr && status == ACPI_LABELS_LOCKED )
201
+ if (test_bit (NFIT_MEM_LSR , & nfit_mem -> flags )
202
+ && status == ACPI_LABELS_LOCKED )
202
203
return - EACCES ;
203
204
break ;
204
205
case ND_CMD_SET_CONFIG_DATA :
205
- if (nfit_mem -> has_lsw && status == ACPI_LABELS_LOCKED )
206
+ if (test_bit (NFIT_MEM_LSW , & nfit_mem -> flags )
207
+ && status == ACPI_LABELS_LOCKED )
206
208
return - EACCES ;
207
209
break ;
208
210
default :
@@ -480,14 +482,16 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
480
482
min_t (u32 , 256 , in_buf .buffer .length ), true);
481
483
482
484
/* call the BIOS, prefer the named methods over _DSM if available */
483
- if (nvdimm && cmd == ND_CMD_GET_CONFIG_SIZE && nfit_mem -> has_lsr )
485
+ if (nvdimm && cmd == ND_CMD_GET_CONFIG_SIZE
486
+ && test_bit (NFIT_MEM_LSR , & nfit_mem -> flags ))
484
487
out_obj = acpi_label_info (handle );
485
- else if (nvdimm && cmd == ND_CMD_GET_CONFIG_DATA && nfit_mem -> has_lsr ) {
488
+ else if (nvdimm && cmd == ND_CMD_GET_CONFIG_DATA
489
+ && test_bit (NFIT_MEM_LSR , & nfit_mem -> flags )) {
486
490
struct nd_cmd_get_config_data_hdr * p = buf ;
487
491
488
492
out_obj = acpi_label_read (handle , p -> in_offset , p -> in_length );
489
493
} else if (nvdimm && cmd == ND_CMD_SET_CONFIG_DATA
490
- && nfit_mem -> has_lsw ) {
494
+ && test_bit ( NFIT_MEM_LSW , & nfit_mem -> flags ) ) {
491
495
struct nd_cmd_set_config_hdr * p = buf ;
492
496
493
497
out_obj = acpi_label_write (handle , p -> in_offset , p -> in_length ,
@@ -1784,12 +1788,13 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
1784
1788
if (acpi_nvdimm_has_method (adev_dimm , "_LSI" )
1785
1789
&& acpi_nvdimm_has_method (adev_dimm , "_LSR" )) {
1786
1790
dev_dbg (dev , "%s: has _LSR\n" , dev_name (& adev_dimm -> dev ));
1787
- nfit_mem -> has_lsr = true ;
1791
+ set_bit ( NFIT_MEM_LSR , & nfit_mem -> flags ) ;
1788
1792
}
1789
1793
1790
- if (nfit_mem -> has_lsr && acpi_nvdimm_has_method (adev_dimm , "_LSW" )) {
1794
+ if (test_bit (NFIT_MEM_LSR , & nfit_mem -> flags )
1795
+ && acpi_nvdimm_has_method (adev_dimm , "_LSW" )) {
1791
1796
dev_dbg (dev , "%s: has _LSW\n" , dev_name (& adev_dimm -> dev ));
1792
- nfit_mem -> has_lsw = true ;
1797
+ set_bit ( NFIT_MEM_LSW , & nfit_mem -> flags ) ;
1793
1798
}
1794
1799
1795
1800
return 0 ;
@@ -1878,11 +1883,11 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
1878
1883
cmd_mask |= nfit_mem -> dsm_mask & NVDIMM_STANDARD_CMDMASK ;
1879
1884
}
1880
1885
1881
- if (nfit_mem -> has_lsr ) {
1886
+ if (test_bit ( NFIT_MEM_LSR , & nfit_mem -> flags ) ) {
1882
1887
set_bit (ND_CMD_GET_CONFIG_SIZE , & cmd_mask );
1883
1888
set_bit (ND_CMD_GET_CONFIG_DATA , & cmd_mask );
1884
1889
}
1885
- if (nfit_mem -> has_lsw )
1890
+ if (test_bit ( NFIT_MEM_LSW , & nfit_mem -> flags ) )
1886
1891
set_bit (ND_CMD_SET_CONFIG_DATA , & cmd_mask );
1887
1892
1888
1893
flush = nfit_mem -> nfit_flush ? nfit_mem -> nfit_flush -> flush
0 commit comments