MIPS: Yosemite, Emma: Fix off-by-two in arcs_cmdline buffer size check
[linux-2.6/linux-mips.git] / arch / arm / plat-mxc / devices / platform-mxc_w1.c
blob96fa5ea91fe8e701eb7192f7ee0e3c4653bdee28
1 /*
2 * Copyright (C) 2010 Pengutronix
3 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
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 */
9 #include <mach/hardware.h>
10 #include <mach/devices-common.h>
12 #define imx_mxc_w1_data_entry_single(soc) \
13 { \
14 .iobase = soc ## _OWIRE_BASE_ADDR, \
17 #ifdef CONFIG_SOC_IMX21
18 const struct imx_mxc_w1_data imx21_mxc_w1_data __initconst =
19 imx_mxc_w1_data_entry_single(MX21);
20 #endif /* ifdef CONFIG_SOC_IMX21 */
22 #ifdef CONFIG_SOC_IMX27
23 const struct imx_mxc_w1_data imx27_mxc_w1_data __initconst =
24 imx_mxc_w1_data_entry_single(MX27);
25 #endif /* ifdef CONFIG_SOC_IMX27 */
27 #ifdef CONFIG_SOC_IMX31
28 const struct imx_mxc_w1_data imx31_mxc_w1_data __initconst =
29 imx_mxc_w1_data_entry_single(MX31);
30 #endif /* ifdef CONFIG_SOC_IMX31 */
32 #ifdef CONFIG_SOC_IMX35
33 const struct imx_mxc_w1_data imx35_mxc_w1_data __initconst =
34 imx_mxc_w1_data_entry_single(MX35);
35 #endif /* ifdef CONFIG_SOC_IMX35 */
37 struct platform_device *__init imx_add_mxc_w1(
38 const struct imx_mxc_w1_data *data)
40 struct resource res[] = {
42 .start = data->iobase,
43 .end = data->iobase + SZ_4K - 1,
44 .flags = IORESOURCE_MEM,
48 return imx_add_platform_device("mxc_w1", 0,
49 res, ARRAY_SIZE(res), NULL, 0);