From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Vinod Koul <vkoul@kernel.org>,
dmaengine@vger.kernel.org, Viresh Kumar <vireshk@kernel.org>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 08/10] dmaengine: dw: platform: Move handle check to dw_dma_acpi_controller_register()
Date: Tue, 20 Aug 2019 16:15:44 +0300 [thread overview]
Message-ID: <20190820131546.75744-9-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20190820131546.75744-1-andriy.shevchenko@linux.intel.com>
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>
---
drivers/dma/dw/platform.c | 12 ++++++++----
1 file 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);
--
2.23.0.rc1
next prev parent reply other threads:[~2019-08-20 13:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 13:15 [PATCH v2 00/10] dmaengine: dw: Enable for Intel Elkhart Lake Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 01/10] dmaengine: acpi: Set up DMA mask based on CSRT Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 02/10] dmaengine: acpi: Add kernel doc parameter descriptions Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 03/10] dmaengine: dw: Export struct dw_dma_chip_pdata for wider use Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 04/10] dmaengine: dw: platform: Use struct dw_dma_chip_pdata Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 05/10] dmaengine: dw: platform: Enable iDMA 32-bit on Intel Elkhart Lake Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 06/10] dmaengine: dw: platform: Use devm_platform_ioremap_resource() Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 07/10] dmaengine: dw: platform: Switch to acpi_dma_controller_register() Andy Shevchenko
2019-08-20 13:15 ` Andy Shevchenko [this message]
2019-08-20 13:15 ` [PATCH v2 09/10] dmaengine: dw: platform: Split ACPI helpers to separate module Andy Shevchenko
2019-08-20 13:15 ` [PATCH v2 10/10] dmaengine: dw: platform: Split OF " Andy Shevchenko
2019-08-21 4:11 ` [PATCH v2 00/10] dmaengine: dw: Enable for Intel Elkhart Lake Vinod Koul
2019-08-28 11:53 ` Andy Shevchenko
2019-08-29 4:32 ` Vinod Koul
2019-08-29 10:39 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190820131546.75744-9-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=jarkko.nikula@linux.intel.com \
--cc=vireshk@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).