Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293499
b: refs/heads/master
c: 2b81ec6
h: refs/heads/master
i:
  293497: 47aea8b
  293495: fa7596a
v: v3
  • Loading branch information
Shawn Guo authored and Mark Brown committed Mar 9, 2012
1 parent 0bfee57 commit 55ac013
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 32 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: 5b596483936230b926898efe10f9cc258d5ed092
refs/heads/master: 2b81ec69144de93f29fa258d3435557a5773ffb5
6 changes: 3 additions & 3 deletions trunk/sound/soc/fsl/fsl_ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,12 @@ static int __devinit fsl_ssi_probe(struct platform_device *pdev)
}

/* Trigger the machine driver's probe function. The platform driver
* name of the machine driver is taken from the /model property of the
* name of the machine driver is taken from /compatible property of the
* device tree. We also pass the address of the CPU DAI driver
* structure.
*/
sprop = of_get_property(of_find_node_by_path("/"), "model", NULL);
/* Sometimes the model name has a "fsl," prefix, so we strip that. */
sprop = of_get_property(of_find_node_by_path("/"), "compatible", NULL);
/* Sometimes the compatible name has a "fsl," prefix, so we strip it. */
p = strrchr(sprop, ',');
if (p)
sprop = p + 1;
Expand Down
2 changes: 1 addition & 1 deletion trunk/sound/soc/fsl/mpc8610_hpcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ static struct platform_driver mpc8610_hpcd_driver = {
.probe = mpc8610_hpcd_probe,
.remove = __devexit_p(mpc8610_hpcd_remove),
.driver = {
/* The name must match the 'model' property in the device tree,
/* The name must match 'compatible' property in the device tree,
* in lowercase letters.
*/
.name = "snd-soc-mpc8610hpcd",
Expand Down
32 changes: 5 additions & 27 deletions trunk/sound/soc/fsl/p1022_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ static struct platform_driver p1022_ds_driver = {
.probe = p1022_ds_probe,
.remove = __devexit_p(p1022_ds_remove),
.driver = {
/*
* The name must match 'compatible' property in the device tree,
* in lowercase letters.
*/
.name = "snd-soc-p1022ds",
.owner = THIS_MODULE,
},
};
Expand All @@ -556,33 +561,6 @@ static int __init p1022_ds_init(void)
{
struct device_node *guts_np;
struct resource res;
const char *sprop;

/*
* Check if we're actually running on a P1022DS. Older device trees
* have a model of "fsl,P1022" and newer ones use "fsl,P1022DS", so we
* need to support both. The SSI driver uses that property to link to
* the machine driver, so have to match it.
*/
sprop = of_get_property(of_find_node_by_path("/"), "model", NULL);
if (!sprop) {
pr_err("snd-soc-p1022ds: missing /model node");
return -ENODEV;
}

pr_debug("snd-soc-p1022ds: board model name is %s\n", sprop);

/*
* The name of this board, taken from the device tree. Normally, this is a*
* fixed string, but some P1022DS device trees have a /model property of
* "fsl,P1022", and others have "fsl,P1022DS".
*/
if (strcasecmp(sprop, "fsl,p1022ds") == 0)
p1022_ds_driver.driver.name = "snd-soc-p1022ds";
else if (strcasecmp(sprop, "fsl,p1022") == 0)
p1022_ds_driver.driver.name = "snd-soc-p1022";
else
return -ENODEV;

/* Get the physical address of the global utilities registers */
guts_np = of_find_compatible_node(NULL, NULL, "fsl,p1022-guts");
Expand Down

0 comments on commit 55ac013

Please sign in to comment.