dma: imx-dma: use devm_kzalloc and devm_request_irq
[linux-2.6-block.git] / arch / arm / mach-imx / devices / platform-imx-dma.c
CommitLineData
8a8d2060
UKK
1/*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 2 as published by the
7 * Free Software Foundation.
8 */
e0557c0d 9#include "devices-common.h"
8a8d2060 10
36223604
SG
11struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
12{
13 return platform_device_register_resndata(&mxc_ahb_bus,
14 "imx-dma", -1, NULL, 0, NULL, 0);
15}
931de392 16
62550cd7 17struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name,
36223604 18 resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
8a8d2060
UKK
19{
20 struct resource res[] = {
21 {
36223604
SG
22 .start = iobase,
23 .end = iobase + SZ_16K - 1,
8a8d2060
UKK
24 .flags = IORESOURCE_MEM,
25 }, {
36223604
SG
26 .start = irq,
27 .end = irq,
8a8d2060
UKK
28 .flags = IORESOURCE_IRQ,
29 },
30 };
31
62550cd7 32 return platform_device_register_resndata(&mxc_ahb_bus, name,
36223604 33 -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
8a8d2060 34}