diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-08-20 16:15:44 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2019-08-21 09:41:28 +0530 |
commit | 84da042e702347c186b84d9cc2e766f83e1814d6 (patch) | |
tree | 7b462763b42eaa16643f7918bbbf36a6385383f4 /drivers | |
parent | e7b8514e4d68bec21fc6385fa0a66797ddc34ac9 (diff) | |
download | talos-op-linux-84da042e702347c186b84d9cc2e766f83e1814d6.tar.gz talos-op-linux-84da042e702347c186b84d9cc2e766f83e1814d6.zip |
dmaengine: dw: platform: Move handle check to dw_dma_acpi_controller_register()
Move ACPI handle check to the dw_dma_acpi_controller_register().
While here, convert it to has_acpi_companion() which is recommended way.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20190820131546.75744-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/dw/platform.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index 44fec1eabccd..b8514d7895d1 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c @@ -76,6 +76,9 @@ static void dw_dma_acpi_controller_register(struct dw_dma *dw) struct acpi_dma_filter_info *info; int ret; + if (!has_acpi_companion(dev)) + return; + info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); if (!info) return; @@ -93,6 +96,9 @@ static void dw_dma_acpi_controller_free(struct dw_dma *dw) { struct device *dev = dw->dma.dev; + if (!has_acpi_companion(dev)) + return; + acpi_dma_controller_free(dev); } #else /* !CONFIG_ACPI */ @@ -239,8 +245,7 @@ static int dw_probe(struct platform_device *pdev) "could not register of_dma_controller\n"); } - if (ACPI_HANDLE(&pdev->dev)) - dw_dma_acpi_controller_register(chip->dw); + dw_dma_acpi_controller_register(chip->dw); return 0; @@ -256,8 +261,7 @@ static int dw_remove(struct platform_device *pdev) struct dw_dma_chip *chip = data->chip; int ret; - if (ACPI_HANDLE(&pdev->dev)) - dw_dma_acpi_controller_free(chip->dw); + dw_dma_acpi_controller_free(chip->dw); if (pdev->dev.of_node) of_dma_controller_free(pdev->dev.of_node); |