Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283843
b: refs/heads/master
c: 6132725
h: refs/heads/master
i:
  283841: bf70f30
  283839: 3ea7930
v: v3
  • Loading branch information
Timur Tabi authored and Mark Brown committed Dec 2, 2011
1 parent eeb2a81 commit 049cd45
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 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: a806aa9207ad59933464efbe6009394723713c0d
refs/heads/master: 6132725eac521b89dee3d58df3c6d04a1e50844c
13 changes: 8 additions & 5 deletions trunk/sound/soc/fsl/mpc8610_hpcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/interrupt.h>
#include <linux/of_device.h>
#include <linux/slab.h>
#include <linux/of_i2c.h>
#include <sound/soc.h>
#include <asm/fsl_guts.h>

Expand Down Expand Up @@ -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);

Expand All @@ -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;
}
Expand Down
13 changes: 8 additions & 5 deletions trunk/sound/soc/fsl/p1022_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/interrupt.h>
#include <linux/of_device.h>
#include <linux/slab.h>
#include <linux/of_i2c.h>
#include <sound/soc.h>
#include <asm/fsl_guts.h>

Expand Down Expand Up @@ -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);

Expand All @@ -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;
}
Expand Down

0 comments on commit 049cd45

Please sign in to comment.