Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
authorMark Brown <broonie@kernel.org>
Wed, 24 Dec 2014 12:56:32 +0000 (12:56 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 24 Dec 2014 12:56:32 +0000 (12:56 +0000)
1  2 
sound/soc/soc-core.c

diff --combined sound/soc/soc-core.c
index 985052b3fbed375dee764a64b63852998532d5e2,d7595465cfbcc877211810e378028de194f541df..2c62620abca691af4033552518eb7138ea6485d5
@@@ -1772,6 -1772,7 +1772,6 @@@ EXPORT_SYMBOL_GPL(snd_soc_pm_ops)
  static struct platform_driver soc_driver = {
        .driver         = {
                .name           = "soc-audio",
 -              .owner          = THIS_MODULE,
                .pm             = &snd_soc_pm_ops,
        },
        .probe          = soc_probe,
@@@ -3230,7 -3231,7 +3230,7 @@@ int snd_soc_of_parse_audio_routing(stru
                                   const char *propname)
  {
        struct device_node *np = card->dev->of_node;
-       int num_routes, old_routes;
+       int num_routes;
        struct snd_soc_dapm_route *routes;
        int i, ret;
  
                return -EINVAL;
        }
  
-       old_routes = card->num_dapm_routes;
-       routes = devm_kzalloc(card->dev,
-                             (old_routes + num_routes) * sizeof(*routes),
+       routes = devm_kzalloc(card->dev, num_routes * sizeof(*routes),
                              GFP_KERNEL);
        if (!routes) {
                dev_err(card->dev,
                return -EINVAL;
        }
  
-       memcpy(routes, card->dapm_routes, old_routes * sizeof(*routes));
        for (i = 0; i < num_routes; i++) {
                ret = of_property_read_string_index(np, propname,
-                       2 * i, &routes[old_routes + i].sink);
+                       2 * i, &routes[i].sink);
                if (ret) {
                        dev_err(card->dev,
                                "ASoC: Property '%s' index %d could not be read: %d\n",
                        return -EINVAL;
                }
                ret = of_property_read_string_index(np, propname,
-                       (2 * i) + 1, &routes[old_routes + i].source);
+                       (2 * i) + 1, &routes[i].source);
                if (ret) {
                        dev_err(card->dev,
                                "ASoC: Property '%s' index %d could not be read: %d\n",
                }
        }
  
-       card->num_dapm_routes += num_routes;
+       card->num_dapm_routes = num_routes;
        card->dapm_routes = routes;
  
        return 0;