ARM: imx: deconstruct mxc_rnga initialization
The rnga platform device is initialized for all imx31 machines from its own initcall, but is never initialized anywhere else. This moves the platform device creation into both the imx31 dt and non-dt machine init sequences, which has basically the exact same effect as before, but makes it more obvious what is going on, while reducing the amount of code and removing the last user of cpu_is_mx31(). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
This commit is contained in:

committad av
Shawn Guo

förälder
6f98cb22e4
incheckning
c9ee94965d
@@ -57,10 +57,6 @@ config IMX_HAVE_PLATFORM_MXC_MMC
|
||||
config IMX_HAVE_PLATFORM_MXC_NAND
|
||||
bool
|
||||
|
||||
config IMX_HAVE_PLATFORM_MXC_RNGA
|
||||
bool
|
||||
select ARCH_HAS_RNGA
|
||||
|
||||
config IMX_HAVE_PLATFORM_MXC_RTC
|
||||
bool
|
||||
|
||||
|
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2010 Pengutronix
|
||||
* Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License version 2 as published by the
|
||||
* Free Software Foundation.
|
||||
*/
|
||||
#include "../hardware.h"
|
||||
#include "devices-common.h"
|
||||
|
||||
struct imx_mxc_rnga_data {
|
||||
resource_size_t iobase;
|
||||
};
|
||||
|
||||
#define imx_mxc_rnga_data_entry_single(soc) \
|
||||
{ \
|
||||
.iobase = soc ## _RNGA_BASE_ADDR, \
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SOC_IMX31
|
||||
static const struct imx_mxc_rnga_data imx31_mxc_rnga_data __initconst =
|
||||
imx_mxc_rnga_data_entry_single(MX31);
|
||||
#endif /* ifdef CONFIG_SOC_IMX31 */
|
||||
|
||||
static struct platform_device *__init imx_add_mxc_rnga(
|
||||
const struct imx_mxc_rnga_data *data)
|
||||
{
|
||||
struct resource res[] = {
|
||||
{
|
||||
.start = data->iobase,
|
||||
.end = data->iobase + SZ_16K - 1,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
};
|
||||
return imx_add_platform_device("mxc_rnga", -1,
|
||||
res, ARRAY_SIZE(res), NULL, 0);
|
||||
}
|
||||
|
||||
static int __init imxXX_add_mxc_rnga(void)
|
||||
{
|
||||
struct platform_device *ret;
|
||||
|
||||
#if defined(CONFIG_SOC_IMX31)
|
||||
if (cpu_is_mx31())
|
||||
ret = imx_add_mxc_rnga(&imx31_mxc_rnga_data);
|
||||
else
|
||||
#endif /* if defined(CONFIG_SOC_IMX31) */
|
||||
ret = ERR_PTR(-ENODEV);
|
||||
|
||||
return PTR_ERR_OR_ZERO(ret);
|
||||
}
|
||||
arch_initcall(imxXX_add_mxc_rnga);
|
Referens i nytt ärende
Block a user