From 049cd45c4e164380f69cc54efa92e8775f286a8b Mon Sep 17 00:00:00 2001 From: Timur Tabi Date: Thu, 1 Dec 2011 19:52:47 -0600 Subject: [PATCH] --- yaml --- r: 283843 b: refs/heads/master c: 6132725eac521b89dee3d58df3c6d04a1e50844c h: refs/heads/master i: 283841: bf70f301c7f3dfe43aeb5f32646b0e453efa2302 283839: 3ea793093fc8088ccc8db3c7eac1f81dbea62186 v: v3 --- [refs] | 2 +- trunk/sound/soc/fsl/mpc8610_hpcd.c | 13 ++++++++----- trunk/sound/soc/fsl/p1022_ds.c | 13 ++++++++----- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index b6ac4ab02ddb..ece640fa4164 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a806aa9207ad59933464efbe6009394723713c0d +refs/heads/master: 6132725eac521b89dee3d58df3c6d04a1e50844c diff --git a/trunk/sound/soc/fsl/mpc8610_hpcd.c b/trunk/sound/soc/fsl/mpc8610_hpcd.c index ae49f1c78c6d..0ea4a5a96e06 100644 --- a/trunk/sound/soc/fsl/mpc8610_hpcd.c +++ b/trunk/sound/soc/fsl/mpc8610_hpcd.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -249,8 +250,9 @@ static int get_parent_cell_index(struct device_node *np) static int codec_node_dev_name(struct device_node *np, char *buf, size_t len) { const u32 *iprop; - int bus, addr; + int addr; char temp[DAI_NAME_SIZE]; + struct i2c_client *i2c; of_modalias_node(np, temp, DAI_NAME_SIZE); @@ -260,11 +262,12 @@ static int codec_node_dev_name(struct device_node *np, char *buf, size_t len) addr = be32_to_cpup(iprop); - bus = get_parent_cell_index(np); - if (bus < 0) - return bus; + /* We need the adapter number */ + i2c = of_find_i2c_device_by_node(np); + if (!i2c) + return -ENODEV; - snprintf(buf, len, "%s-codec.%u-%04x", temp, bus, addr); + snprintf(buf, len, "%s-codec.%u-%04x", temp, i2c->adapter->nr, addr); return 0; } diff --git a/trunk/sound/soc/fsl/p1022_ds.c b/trunk/sound/soc/fsl/p1022_ds.c index 309162652287..a5d4e80a9cf4 100644 --- a/trunk/sound/soc/fsl/p1022_ds.c +++ b/trunk/sound/soc/fsl/p1022_ds.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -252,8 +253,9 @@ static int get_parent_cell_index(struct device_node *np) static int codec_node_dev_name(struct device_node *np, char *buf, size_t len) { const u32 *iprop; - int bus, addr; + int addr; char temp[DAI_NAME_SIZE]; + struct i2c_client *i2c; of_modalias_node(np, temp, DAI_NAME_SIZE); @@ -263,11 +265,12 @@ static int codec_node_dev_name(struct device_node *np, char *buf, size_t len) addr = be32_to_cpup(iprop); - bus = get_parent_cell_index(np); - if (bus < 0) - return bus; + /* We need the adapter number */ + i2c = of_find_i2c_device_by_node(np); + if (!i2c) + return -ENODEV; - snprintf(buf, len, "%s.%u-%04x", temp, bus, addr); + snprintf(buf, len, "%s.%u-%04x", temp, i2c->adapter->nr, addr); return 0; }