* [PATCH] dma: tegra: assume CONFIG_OF
@ 2013-02-15 21:53 ` Stephen Warren
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Warren @ 2013-02-15 21:53 UTC (permalink / raw)
To: Dan Williams
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Stephen Warren
From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Tegra only supports, and always enables, device tree. Remove all ifdefs
and runtime checks for DT support from the driver.
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/dma/tegra20-apb-dma.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index fcee27e..5a0b66c 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1213,7 +1213,6 @@ static const struct tegra_dma_chip_data tegra20_dma_chip_data = {
.support_channel_pause = false,
};
-#if defined(CONFIG_OF)
/* Tegra30 specific DMA controller information */
static const struct tegra_dma_chip_data tegra30_dma_chip_data = {
.nr_channels = 32,
@@ -1243,7 +1242,6 @@ static const struct of_device_id tegra_dma_of_match[] = {
},
};
MODULE_DEVICE_TABLE(of, tegra_dma_of_match);
-#endif
static int tegra_dma_probe(struct platform_device *pdev)
{
@@ -1252,20 +1250,14 @@ static int tegra_dma_probe(struct platform_device *pdev)
int ret;
int i;
const struct tegra_dma_chip_data *cdata = NULL;
+ const struct of_device_id *match;
- if (pdev->dev.of_node) {
- const struct of_device_id *match;
- match = of_match_device(of_match_ptr(tegra_dma_of_match),
- &pdev->dev);
- if (!match) {
- dev_err(&pdev->dev, "Error: No device match found\n");
- return -ENODEV;
- }
- cdata = match->data;
- } else {
- /* If no device tree then fallback to tegra20 */
- cdata = &tegra20_dma_chip_data;
+ match = of_match_device(tegra_dma_of_match, &pdev->dev);
+ if (!match) {
+ dev_err(&pdev->dev, "Error: No device match found\n");
+ return -ENODEV;
}
+ cdata = match->data;
tdma = devm_kzalloc(&pdev->dev, sizeof(*tdma) + cdata->nr_channels *
sizeof(struct tegra_dma_channel), GFP_KERNEL);
@@ -1460,7 +1452,7 @@ static struct platform_driver tegra_dmac_driver = {
.name = "tegra-apbdma",
.owner = THIS_MODULE,
.pm = &tegra_dma_dev_pm_ops,
- .of_match_table = of_match_ptr(tegra_dma_of_match),
+ .of_match_table = tegra_dma_of_match,
},
.probe = tegra_dma_probe,
.remove = tegra_dma_remove,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH] dma: tegra: assume CONFIG_OF
@ 2013-02-15 21:53 ` Stephen Warren
0 siblings, 0 replies; 7+ messages in thread
From: Stephen Warren @ 2013-02-15 21:53 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-tegra, linux-kernel, Stephen Warren
From: Stephen Warren <swarren@nvidia.com>
Tegra only supports, and always enables, device tree. Remove all ifdefs
and runtime checks for DT support from the driver.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
drivers/dma/tegra20-apb-dma.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index fcee27e..5a0b66c 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1213,7 +1213,6 @@ static const struct tegra_dma_chip_data tegra20_dma_chip_data = {
.support_channel_pause = false,
};
-#if defined(CONFIG_OF)
/* Tegra30 specific DMA controller information */
static const struct tegra_dma_chip_data tegra30_dma_chip_data = {
.nr_channels = 32,
@@ -1243,7 +1242,6 @@ static const struct of_device_id tegra_dma_of_match[] = {
},
};
MODULE_DEVICE_TABLE(of, tegra_dma_of_match);
-#endif
static int tegra_dma_probe(struct platform_device *pdev)
{
@@ -1252,20 +1250,14 @@ static int tegra_dma_probe(struct platform_device *pdev)
int ret;
int i;
const struct tegra_dma_chip_data *cdata = NULL;
+ const struct of_device_id *match;
- if (pdev->dev.of_node) {
- const struct of_device_id *match;
- match = of_match_device(of_match_ptr(tegra_dma_of_match),
- &pdev->dev);
- if (!match) {
- dev_err(&pdev->dev, "Error: No device match found\n");
- return -ENODEV;
- }
- cdata = match->data;
- } else {
- /* If no device tree then fallback to tegra20 */
- cdata = &tegra20_dma_chip_data;
+ match = of_match_device(tegra_dma_of_match, &pdev->dev);
+ if (!match) {
+ dev_err(&pdev->dev, "Error: No device match found\n");
+ return -ENODEV;
}
+ cdata = match->data;
tdma = devm_kzalloc(&pdev->dev, sizeof(*tdma) + cdata->nr_channels *
sizeof(struct tegra_dma_channel), GFP_KERNEL);
@@ -1460,7 +1452,7 @@ static struct platform_driver tegra_dmac_driver = {
.name = "tegra-apbdma",
.owner = THIS_MODULE,
.pm = &tegra_dma_dev_pm_ops,
- .of_match_table = of_match_ptr(tegra_dma_of_match),
+ .of_match_table = tegra_dma_of_match,
},
.probe = tegra_dma_probe,
.remove = tegra_dma_remove,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 7+ messages in thread[parent not found: <1360965237-14857-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>]
* Re: [PATCH] dma: tegra: assume CONFIG_OF
2013-02-15 21:53 ` Stephen Warren
@ 2013-02-15 22:18 ` Dan Williams
-1 siblings, 0 replies; 7+ messages in thread
From: Dan Williams @ 2013-02-15 22:18 UTC (permalink / raw)
To: Stephen Warren
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Stephen Warren, Koul, Vinod
On Fri, Feb 15, 2013 at 1:53 PM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> Tegra only supports, and always enables, device tree. Remove all ifdefs
> and runtime checks for DT support from the driver.
>
> Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Acked-by: Dan Williams <djbw-b10kYP2dOMg@public.gmane.org>
..adding Vinod.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: assume CONFIG_OF
@ 2013-02-15 22:18 ` Dan Williams
0 siblings, 0 replies; 7+ messages in thread
From: Dan Williams @ 2013-02-15 22:18 UTC (permalink / raw)
To: Stephen Warren; +Cc: linux-tegra, linux-kernel, Stephen Warren, Koul, Vinod
On Fri, Feb 15, 2013 at 1:53 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Tegra only supports, and always enables, device tree. Remove all ifdefs
> and runtime checks for DT support from the driver.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Dan Williams <djbw@fb.com>
..adding Vinod.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dma: tegra: assume CONFIG_OF
2013-02-15 22:18 ` Dan Williams
(?)
@ 2013-02-17 15:07 ` Vinod Koul
[not found] ` <20130217150735.GK29960-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
-1 siblings, 1 reply; 7+ messages in thread
From: Vinod Koul @ 2013-02-17 15:07 UTC (permalink / raw)
To: Dan Williams; +Cc: Stephen Warren, linux-tegra, linux-kernel, Stephen Warren
On Fri, Feb 15, 2013 at 02:18:59PM -0800, Dan Williams wrote:
> On Fri, Feb 15, 2013 at 1:53 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> > From: Stephen Warren <swarren@nvidia.com>
> >
> > Tegra only supports, and always enables, device tree. Remove all ifdefs
> > and runtime checks for DT support from the driver.
> >
> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
>
> Acked-by: Dan Williams <djbw@fb.com>
>
> ..adding Vinod.
I think it should assume CONFIG_DMA_OF?
--
~Vinod
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-02-19 17:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 21:53 [PATCH] dma: tegra: assume CONFIG_OF Stephen Warren
2013-02-15 21:53 ` Stephen Warren
[not found] ` <1360965237-14857-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-15 22:18 ` Dan Williams
2013-02-15 22:18 ` Dan Williams
2013-02-17 15:07 ` Vinod Koul
[not found] ` <20130217150735.GK29960-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-02-19 17:06 ` Stephen Warren
2013-02-19 17:06 ` Stephen Warren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.