base: Don't use shared buffer for results of dev_id()
Using shared memory buffer to return results of dev_id() leads to
incorrect results when used as follows:

    dev_info(..., "... %s ...\n", ..., dev_name(foo), ...);

since result returned for dev_name(foo) will be overwritten by
dev_name() call that will happen as a part of dev_* logging functions.

To prevent that allocate a dedicated field "unique_name" in struct
device_d and use it to store unique name returned by
dev_id()/dev_name().

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 0568376 commit e317adeeb7c50a5eeb0a88da39857c7cc6f9b366
@Andrey Smirnov Andrey Smirnov authored on 16 Oct 2018
Sascha Hauer committed on 18 Oct 2018
Showing 2 changed files
View
drivers/base/driver.c
View
include/driver.h