| @@ -26,7 +26,6 @@ · 25 unmodified lines |
| 26 | #include <acpi/nfit.h> | 26 | #include <acpi/nfit.h> |
| 27 | #include "intel.h" | 27 | #include "intel.h" |
| 28 | #include "nfit.h" | 28 | #include "nfit.h" |
| 29 | #include "intel.h" | | |
| 30 | | 29 | |
| 31 | /* | 30 | /* |
| 32 | * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is | 31 | * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is |
| @@ -78,12 +77,6 @@ const guid_t *to_nfit_uuid(enum nfit_uuids id) · 45 unmodified lines |
| 78 | } | 77 | } |
| 79 | EXPORT_SYMBOL(to_nfit_uuid); | 78 | EXPORT_SYMBOL(to_nfit_uuid); |
| 80 | | 79 | |
| 81 | static struct acpi_nfit_desc *to_acpi_nfit_desc( | | |
| 82 | struct nvdimm_bus_descriptor *nd_desc) | | |
| 83 | { | | |
| 84 | return container_of(nd_desc, struct acpi_nfit_desc, nd_desc); | | |
| 85 | } | | |
| 86 | | | |
| 87 | static struct acpi_device *to_acpi_dev(struct acpi_nfit_desc *acpi_desc) | 80 | static struct acpi_device *to_acpi_dev(struct acpi_nfit_desc *acpi_desc) |
| 88 | { | 81 | { |
| 89 | struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc; | 82 | struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc; |
| @@ -419,7 +412,7 @@ static bool payload_dumpable(struct nvdimm *nvdimm, unsigned int func) · 329 unmodified lines |
| 419 | int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, | 412 | int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, |
| 420 | unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc) | 413 | unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc) |
| 421 | { | 414 | { |
| 422 | struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); | 415 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); |
| 423 | struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); | 416 | struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); |
| 424 | union acpi_object in_obj, in_buf, *out_obj; | 417 | union acpi_object in_obj, in_buf, *out_obj; |
| 425 | const struct nd_cmd_desc *desc = NULL; | 418 | const struct nd_cmd_desc *desc = NULL; |
| @@ -721,6 +714,7 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags) · 295 unmodified lines |
| 721 | struct acpi_nfit_memory_map *memdev; | 714 | struct acpi_nfit_memory_map *memdev; |
| 722 | struct acpi_nfit_desc *acpi_desc; | 715 | struct acpi_nfit_desc *acpi_desc; |
| 723 | struct nfit_mem *nfit_mem; | 716 | struct nfit_mem *nfit_mem; |
| | 717 | u16 physical_id; |
| 724 | | 718 | |
| 725 | mutex_lock(&acpi_desc_lock); | 719 | mutex_lock(&acpi_desc_lock); |
| 726 | list_for_each_entry(acpi_desc, &acpi_descs, list) { | 720 | list_for_each_entry(acpi_desc, &acpi_descs, list) { |
| @@ -728,10 +722,11 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags) · 1 unmodified line |
| 728 | list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { | 722 | list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) { |
| 729 | memdev = __to_nfit_memdev(nfit_mem); | 723 | memdev = __to_nfit_memdev(nfit_mem); |
| 730 | if (memdev->device_handle == device_handle) { | 724 | if (memdev->device_handle == device_handle) { |
| | 725 | *flags = memdev->flags; |
| | 726 | physical_id = memdev->physical_id; |
| 731 | mutex_unlock(&acpi_desc->init_mutex); | 727 | mutex_unlock(&acpi_desc->init_mutex); |
| 732 | mutex_unlock(&acpi_desc_lock); | 728 | mutex_unlock(&acpi_desc_lock); |
| 733 | *flags = memdev->flags; | 729 | return physical_id; |
| 734 | return memdev->physical_id; | | |
| 735 | } | 730 | } |
| 736 | } | 731 | } |
| 737 | mutex_unlock(&acpi_desc->init_mutex); | 732 | mutex_unlock(&acpi_desc->init_mutex); |
| @@ -2231,7 +2226,6 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, · 1493 unmodified lines |
| 2231 | nd_set = devm_kzalloc(dev, sizeof(*nd_set), GFP_KERNEL); | 2226 | nd_set = devm_kzalloc(dev, sizeof(*nd_set), GFP_KERNEL); |
| 2232 | if (!nd_set) | 2227 | if (!nd_set) |
| 2233 | return -ENOMEM; | 2228 | return -ENOMEM; |
| 2234 | ndr_desc->nd_set = nd_set; | | |
| 2235 | guid_copy(&nd_set->type_guid, (guid_t *) spa->range_guid); | 2229 | guid_copy(&nd_set->type_guid, (guid_t *) spa->range_guid); |
| 2236 | | 2230 | |
| 2237 | info = devm_kzalloc(dev, sizeof_nfit_set_info(nr), GFP_KERNEL); | 2231 | info = devm_kzalloc(dev, sizeof_nfit_set_info(nr), GFP_KERNEL); |
| @@ -3367,7 +3361,7 @@ EXPORT_SYMBOL_GPL(acpi_nfit_init); · 1129 unmodified lines |
| 3367 | | 3361 | |
| 3368 | static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) | 3362 | static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) |
| 3369 | { | 3363 | { |
| 3370 | struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); | 3364 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); |
| 3371 | struct device *dev = acpi_desc->dev; | 3365 | struct device *dev = acpi_desc->dev; |
| 3372 | | 3366 | |
| 3373 | /* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */ | 3367 | /* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */ |
| @@ -3384,7 +3378,7 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) · 10 unmodified lines |
| 3384 | static int __acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc, | 3378 | static int __acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc, |
| 3385 | struct nvdimm *nvdimm, unsigned int cmd) | 3379 | struct nvdimm *nvdimm, unsigned int cmd) |
| 3386 | { | 3380 | { |
| 3387 | struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc); | 3381 | struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc); |
| 3388 | | 3382 | |
| 3389 | if (nvdimm) | 3383 | if (nvdimm) |
| 3390 | return 0; | 3384 | return 0; |