Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

device property: ACPI: Remove unused DMA APIs

These DMA APIs are replaced with the newer versions, which return
the enum dev_dma_attr. So, we can safely remove them.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Suthikulpanit, Suravee and committed by
Rafael J. Wysocki
ab3d5273 1831eff8

-54
-13
drivers/base/property.c
··· 598 598 } 599 599 EXPORT_SYMBOL_GPL(device_get_child_node_count); 600 600 601 - bool device_dma_is_coherent(struct device *dev) 602 - { 603 - bool coherent = false; 604 - 605 - if (IS_ENABLED(CONFIG_OF) && dev->of_node) 606 - coherent = of_dma_is_coherent(dev->of_node); 607 - else 608 - acpi_check_dma(ACPI_COMPANION(dev), &coherent); 609 - 610 - return coherent; 611 - } 612 - EXPORT_SYMBOL_GPL(device_dma_is_coherent); 613 - 614 601 bool device_dma_supported(struct device *dev) 615 602 { 616 603 /* For DT, this is always supported.
-34
include/acpi/acpi_bus.h
··· 390 390 struct completion kobj_done; 391 391 }; 392 392 393 - static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent) 394 - { 395 - bool ret = false; 396 - 397 - if (!adev) 398 - return ret; 399 - 400 - /** 401 - * Currently, we only support _CCA=1 (i.e. coherent_dma=1) 402 - * This should be equivalent to specifyig dma-coherent for 403 - * a device in OF. 404 - * 405 - * For the case when _CCA=0 (i.e. coherent_dma=0 && cca_seen=1), 406 - * There are two cases: 407 - * case 1. Do not support and disable DMA. 408 - * case 2. Support but rely on arch-specific cache maintenance for 409 - * non-coherence DMA operations. 410 - * Currently, we implement case 2 above. 411 - * 412 - * For the case when _CCA is missing (i.e. cca_seen=0) and 413 - * platform specifies ACPI_CCA_REQUIRED, we do not support DMA, 414 - * and fallback to arch-specific default handling. 415 - * 416 - * See acpi_init_coherency() for more info. 417 - */ 418 - if (adev->flags.coherent_dma || 419 - (adev->flags.cca_seen && IS_ENABLED(CONFIG_ARM64))) { 420 - ret = true; 421 - if (coherent) 422 - *coherent = adev->flags.coherent_dma; 423 - } 424 - return ret; 425 - } 426 - 427 393 static inline bool is_acpi_node(struct fwnode_handle *fwnode) 428 394 { 429 395 return fwnode && (fwnode->type == FWNODE_ACPI
-5
include/linux/acpi.h
··· 574 574 return -ENODEV; 575 575 } 576 576 577 - static inline bool acpi_check_dma(struct acpi_device *adev, bool *coherent) 578 - { 579 - return false; 580 - } 581 - 582 577 static inline bool acpi_dma_supported(struct acpi_device *adev) 583 578 { 584 579 return false;
-2
include/linux/property.h
··· 174 174 175 175 void device_add_property_set(struct device *dev, struct property_set *pset); 176 176 177 - bool device_dma_is_coherent(struct device *dev); 178 - 179 177 bool device_dma_supported(struct device *dev); 180 178 181 179 enum dev_dma_attr device_get_dma_attr(struct device *dev);