1 Jul
2014
1 Jul
'14
4:57 p.m.
On 07/01/2014 04:49 PM, Huang Tao wrote:
Dear Lars:
于 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