Re: [PATCH v6 6/9] ASoC: simple-card-utils: enable "label" on asoc_simple_card_parse_card_name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Rob

> >  int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
> >                                      char *prefix)
> >  {
> > +       char * const names[] = {
> > +               "label", "name"
> > +       };
> >         char prop[128];
> > +       int i;
> >         int ret;
> >
> > -       snprintf(prop, sizeof(prop), "%sname", prefix);
> > +       if (!prefix)
> > +               prefix = "";
> >
> >         /* Parse the card name from DT */
> > -       ret = snd_soc_of_parse_card_name(card, prop);
> > -       if (ret < 0)
> > -               return ret;
> > +       for (i = 0; i < ARRAY_SIZE(names); i++) {
> > +               snprintf(prop, sizeof(prop), "%s%s", prefix, names[i]);
> > +               ret = snd_soc_of_parse_card_name(card, prop);
> > +               if (ret < 0)
> > +                       return ret;
> > +               if (card->name)
> > +                       break;
> > +       }
> 
> This is still wrong as you are allowing "<prefix>label" for property
> names. I think you want something like this:
> 
> ret = snd_soc_of_parse_card_name(card, "label");
> if (ret < 0) {
>   char prop[128];
>   snprintf(prop, sizeof(prop), "%sname", prefix);
>   /* Parse the card name from DT */
>   ret = snd_soc_of_parse_card_name(card, prop);
>   if (ret < 0)
>     return ret;
> }

OK, will fix

Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux