Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355450
b: refs/heads/master
c: be1f948
h: refs/heads/master
v: v3
  • Loading branch information
Tony Lindgren committed Jan 11, 2013
1 parent 279ee08 commit 3a4bda0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a6cf912c6047077a6eb860ed8dbfa342376ee395
refs/heads/master: be1f94812c2cc0aaf696d39fe23104763ea52b5b
18 changes: 16 additions & 2 deletions trunk/arch/arm/mach-omap1/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <linux/init.h>
#include <linux/device.h>
#include <linux/io.h>

#include <linux/dma-mapping.h>
#include <linux/omap-dma.h>
#include <mach/tc.h>

Expand Down Expand Up @@ -270,11 +270,17 @@ static u32 configure_dma_errata(void)
return errata;
}

static const struct platform_device_info omap_dma_dev_info = {
.name = "omap-dma-engine",
.id = -1,
.dma_mask = DMA_BIT_MASK(32),
};

static int __init omap1_system_dma_init(void)
{
struct omap_system_dma_plat_info *p;
struct omap_dma_dev_attr *d;
struct platform_device *pdev;
struct platform_device *pdev, *dma_pdev;
int ret;

pdev = platform_device_alloc("omap_dma_system", 0);
Expand Down Expand Up @@ -380,8 +386,16 @@ static int __init omap1_system_dma_init(void)
dma_common_ch_start = CPC;
dma_common_ch_end = COLOR;

dma_pdev = platform_device_register_full(&omap_dma_dev_info);
if (IS_ERR(dma_pdev)) {
ret = PTR_ERR(dma_pdev);
goto exit_release_pdev;
}

return ret;

exit_release_pdev:
platform_device_del(pdev);
exit_release_chan:
kfree(d->chan);
exit_release_d:
Expand Down
21 changes: 19 additions & 2 deletions trunk/arch/arm/mach-omap2/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>

#include <linux/dma-mapping.h>
#include <linux/omap-dma.h>

#include "soc.h"
Expand Down Expand Up @@ -288,9 +288,26 @@ static int __init omap2_system_dma_init_dev(struct omap_hwmod *oh, void *unused)
return 0;
}

static const struct platform_device_info omap_dma_dev_info = {
.name = "omap-dma-engine",
.id = -1,
.dma_mask = DMA_BIT_MASK(32),
};

static int __init omap2_system_dma_init(void)
{
return omap_hwmod_for_each_by_class("dma",
struct platform_device *pdev;
int res;

res = omap_hwmod_for_each_by_class("dma",
omap2_system_dma_init_dev, NULL);
if (res)
return res;

pdev = platform_device_register_full(&omap_dma_dev_info);
if (IS_ERR(pdev))
return PTR_ERR(pdev);

return res;
}
omap_arch_initcall(omap2_system_dma_init);
20 changes: 1 addition & 19 deletions trunk/drivers/dma/omap-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,32 +661,14 @@ bool omap_dma_filter_fn(struct dma_chan *chan, void *param)
}
EXPORT_SYMBOL_GPL(omap_dma_filter_fn);

static struct platform_device *pdev;

static const struct platform_device_info omap_dma_dev_info = {
.name = "omap-dma-engine",
.id = -1,
.dma_mask = DMA_BIT_MASK(32),
};

static int omap_dma_init(void)
{
int rc = platform_driver_register(&omap_dma_driver);

if (rc == 0) {
pdev = platform_device_register_full(&omap_dma_dev_info);
if (IS_ERR(pdev)) {
platform_driver_unregister(&omap_dma_driver);
rc = PTR_ERR(pdev);
}
}
return rc;
return platform_driver_register(&omap_dma_driver);
}
subsys_initcall(omap_dma_init);

static void __exit omap_dma_exit(void)
{
platform_device_unregister(pdev);
platform_driver_unregister(&omap_dma_driver);
}
module_exit(omap_dma_exit);
Expand Down

0 comments on commit 3a4bda0

Please sign in to comment.