Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: OMAP: fix omap i2c init (regression)

In mainline, the "old style" I2C registration was only removed for
OMAP2, leading to init-time bugs (regressions) like:

sysfs: duplicate filename 'i2c_omap.1' can not be created
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:424 sysfs_add_one+0x40/0xd4()
Modules linked in:
... deletia ...
[<c0036a38>] (omap_init_i2c+0x0/0x50) from [<c000cea8>] (omap_init_devices+0x10/0x24)
r4:c001e000
[<c000ce98>] (omap_init_devices+0x0/0x24) from [<c0008684>] (do_initcalls+0x78/0x200)
... deletia ...
---[ end trace ca143223eefdc828 ]---
kobject_add_internal failed for i2c_omap.1 with -EEXIST, don't try to register things with the same name in the same directory.

The fix is obvious: remove the old init code, it's no longer needed.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>

authored by

David Brownell and committed by
Tony Lindgren
cfa9a63a 8ba55c5c

-63
-63
arch/arm/plat-omap/devices.c
··· 89 89 #endif /* CONFIG_OMAP_DSP */ 90 90 91 91 /*-------------------------------------------------------------------------*/ 92 - #if defined(CONFIG_I2C_OMAP) || defined(CONFIG_I2C_OMAP_MODULE) 93 - 94 - #define OMAP1_I2C_BASE 0xfffb3800 95 - #define OMAP2_I2C_BASE1 0x48070000 96 - #define OMAP_I2C_SIZE 0x3f 97 - #define OMAP1_I2C_INT INT_I2C 98 - #define OMAP2_I2C_INT1 56 99 - 100 - static struct resource i2c_resources1[] = { 101 - { 102 - .start = 0, 103 - .end = 0, 104 - .flags = IORESOURCE_MEM, 105 - }, 106 - { 107 - .start = 0, 108 - .flags = IORESOURCE_IRQ, 109 - }, 110 - }; 111 - 112 - /* DMA not used; works around erratum writing to non-empty i2c fifo */ 113 - 114 - static struct platform_device omap_i2c_device1 = { 115 - .name = "i2c_omap", 116 - .id = 1, 117 - .num_resources = ARRAY_SIZE(i2c_resources1), 118 - .resource = i2c_resources1, 119 - }; 120 - 121 - /* See also arch/arm/mach-omap2/devices.c for second I2C on 24xx */ 122 - static void omap_init_i2c(void) 123 - { 124 - if (cpu_is_omap24xx()) { 125 - i2c_resources1[0].start = OMAP2_I2C_BASE1; 126 - i2c_resources1[0].end = OMAP2_I2C_BASE1 + OMAP_I2C_SIZE; 127 - i2c_resources1[1].start = OMAP2_I2C_INT1; 128 - } else { 129 - i2c_resources1[0].start = OMAP1_I2C_BASE; 130 - i2c_resources1[0].end = OMAP1_I2C_BASE + OMAP_I2C_SIZE; 131 - i2c_resources1[1].start = OMAP1_I2C_INT; 132 - } 133 - 134 - /* FIXME define and use a boot tag, in case of boards that 135 - * either don't wire up I2C, or chips that mux it differently... 136 - * it can include clocking and address info, maybe more. 137 - */ 138 - if (cpu_is_omap24xx()) { 139 - omap_cfg_reg(M19_24XX_I2C1_SCL); 140 - omap_cfg_reg(L15_24XX_I2C1_SDA); 141 - } else { 142 - omap_cfg_reg(I2C_SCL); 143 - omap_cfg_reg(I2C_SDA); 144 - } 145 - 146 - (void) platform_device_register(&omap_i2c_device1); 147 - } 148 - 149 - #else 150 - static inline void omap_init_i2c(void) {} 151 - #endif 152 - 153 - /*-------------------------------------------------------------------------*/ 154 92 #if defined(CONFIG_KEYBOARD_OMAP) || defined(CONFIG_KEYBOARD_OMAP_MODULE) 155 93 156 94 static void omap_init_kp(void) ··· 439 501 * in alphabetical order so they're easier to sort through. 440 502 */ 441 503 omap_init_dsp(); 442 - omap_init_i2c(); 443 504 omap_init_kp(); 444 505 omap_init_mmc(); 445 506 omap_init_uwire();