[alsa-devel] [PATCH 2/2] ASoC: add driver for Rockchip RK3xxx I2S controller

Huang Tao huangtao at rock-chips.com
Tue Jul 1 17:17:35 CEST 2014


   于 2014年07月01日 22:57, Lars-Peter Clausen 写道:


于 2014年07月01日 17:51, Lars-Peter Clausen 写道:

+       /* Try to set the I2S Channel id from dt */

+       pdev->id = of_alias_get_id(np, "i2s");
+       dev_set_name(&pdev->dev, "%s.%d",
+                               pdev->dev.driver->name,
+                               pdev->id);

A device should not change its id or name.


Could you tell me the reason?


When registering a device the Linux device core that the id and name are
unique. If you change them behind the back of the core there is no guarantee
that they are still unique and undefined behavior might occur. Also changing
them can cause all kind of other weird behavior, e.g. the name no longer
matches the name of the sysfs files, etc.

- Lars


   OK. Thanks! We will follow this rule on the future patches.

   Best Regards,


    Huang Tao


More information about the Alsa-devel mailing list