diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-04-30 10:03:33 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-08-10 07:14:36 -0400 |
commit | de9234306bb28fe6c8c3bb908e3f9956f5276a02 (patch) | |
tree | 5ba5c3d36e9f0178ad1a709fdaf44cd31f54a9b5 /arch/arm | |
parent | 15b5eb2d913f857ad30b0b4f1cd6867495962221 (diff) |
ARM: davinci: remove broken ntosd2_init_i2c
ntosd2_init_i2c walks the ntosd2_i2c_info array, which it expects to
be populated with at least one member. gcc correctly warns about
the out-of-bounds access here.
Since this can not possibly work, it's better to disable i2c
support entirely on this board.
Without this patch, building davinci_all_defconfig results in:
arch/arm/mach-davinci/board-neuros-osd2.c: In function 'davinci_ntosd2_init':
arch/arm/mach-davinci/board-neuros-osd2.c:187:20: warning: array subscript is above array bounds [-Warray-bounds]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Andrey Porodko <panda@chelcom.ru>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-davinci/board-neuros-osd2.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c index 5de69f2fcca9..f6b9fc70161b 100644 --- a/arch/arm/mach-davinci/board-neuros-osd2.c +++ b/arch/arm/mach-davinci/board-neuros-osd2.c | |||
@@ -162,38 +162,6 @@ static void __init davinci_ntosd2_map_io(void) | |||
162 | dm644x_init(); | 162 | dm644x_init(); |
163 | } | 163 | } |
164 | 164 | ||
165 | /* | ||
166 | I2C initialization | ||
167 | */ | ||
168 | static struct davinci_i2c_platform_data ntosd2_i2c_pdata = { | ||
169 | .bus_freq = 20 /* kHz */, | ||
170 | .bus_delay = 100 /* usec */, | ||
171 | }; | ||
172 | |||
173 | static struct i2c_board_info __initdata ntosd2_i2c_info[] = { | ||
174 | }; | ||
175 | |||
176 | static int ntosd2_init_i2c(void) | ||
177 | { | ||
178 | int status; | ||
179 | |||
180 | davinci_init_i2c(&ntosd2_i2c_pdata); | ||
181 | status = gpio_request(NTOSD2_MSP430_IRQ, ntosd2_i2c_info[0].type); | ||
182 | if (status == 0) { | ||
183 | status = gpio_direction_input(NTOSD2_MSP430_IRQ); | ||
184 | if (status == 0) { | ||
185 | status = gpio_to_irq(NTOSD2_MSP430_IRQ); | ||
186 | if (status > 0) { | ||
187 | ntosd2_i2c_info[0].irq = status; | ||
188 | i2c_register_board_info(1, | ||
189 | ntosd2_i2c_info, | ||
190 | ARRAY_SIZE(ntosd2_i2c_info)); | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | return status; | ||
195 | } | ||
196 | |||
197 | static struct davinci_mmc_config davinci_ntosd2_mmc_config = { | 165 | static struct davinci_mmc_config davinci_ntosd2_mmc_config = { |
198 | .wires = 4, | 166 | .wires = 4, |
199 | .version = MMC_CTLR_VERSION_1 | 167 | .version = MMC_CTLR_VERSION_1 |
@@ -218,7 +186,6 @@ static __init void davinci_ntosd2_init(void) | |||
218 | { | 186 | { |
219 | struct clk *aemif_clk; | 187 | struct clk *aemif_clk; |
220 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 188 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
221 | int status; | ||
222 | 189 | ||
223 | aemif_clk = clk_get(NULL, "aemif"); | 190 | aemif_clk = clk_get(NULL, "aemif"); |
224 | clk_enable(aemif_clk); | 191 | clk_enable(aemif_clk); |
@@ -242,12 +209,6 @@ static __init void davinci_ntosd2_init(void) | |||
242 | platform_add_devices(davinci_ntosd2_devices, | 209 | platform_add_devices(davinci_ntosd2_devices, |
243 | ARRAY_SIZE(davinci_ntosd2_devices)); | 210 | ARRAY_SIZE(davinci_ntosd2_devices)); |
244 | 211 | ||
245 | /* Initialize I2C interface specific for this board */ | ||
246 | status = ntosd2_init_i2c(); | ||
247 | if (status < 0) | ||
248 | pr_warning("davinci_ntosd2_init: msp430 irq setup failed:" | ||
249 | " %d\n", status); | ||
250 | |||
251 | davinci_serial_init(&uart_config); | 212 | davinci_serial_init(&uart_config); |
252 | dm644x_init_asp(&dm644x_ntosd2_snd_data); | 213 | dm644x_init_asp(&dm644x_ntosd2_snd_data); |
253 | 214 | ||