Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101631
b: refs/heads/master
c: e026892
h: refs/heads/master
i:
  101629: e5857aa
  101627: feeee18
  101623: d555e8d
  101615: c86298f
  101599: 2a00316
  101567: 25e295f
  101503: f4cb2de
  101375: 41a723b
v: v3
  • Loading branch information
Timur Tabi authored and Kumar Gala committed Jun 3, 2008
1 parent a5d057a commit ce916a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fca622c5b21a259950a2964ceca7b6c2a23c849f
refs/heads/master: e026892c85571e12f11abffde5a90bcc704d663e
10 changes: 8 additions & 2 deletions trunk/arch/powerpc/sysdev/fsl_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ static int __init fsl_i2c_of_init(void)
struct resource r[2];
struct fsl_i2c_platform_data i2c_data;
const unsigned char *flags = NULL;
int idx;
const u32 *iprop;

memset(&r, 0, sizeof(r));
memset(&i2c_data, 0, sizeof(i2c_data));
Expand All @@ -506,7 +508,10 @@ static int __init fsl_i2c_of_init(void)

of_irq_to_resource(np, 0, &r[1]);

i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
iprop = of_get_property(np, "cell-index", NULL);
idx = iprop ? *iprop : i;

i2c_dev = platform_device_register_simple("fsl-i2c", idx, r, 2);
if (IS_ERR(i2c_dev)) {
ret = PTR_ERR(i2c_dev);
goto err;
Expand All @@ -528,7 +533,8 @@ static int __init fsl_i2c_of_init(void)
if (ret)
goto unreg;

of_register_i2c_devices(np, i++);
of_register_i2c_devices(np, idx);
i++;
}

return 0;
Expand Down

0 comments on commit ce916a4

Please sign in to comment.