9
0
Fork 0

driver: add dev_name inline

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2009-10-30 22:55:23 +01:00 committed by Sascha Hauer
parent 318e743323
commit 483d4e0857
1 changed files with 6 additions and 1 deletions

View File

@ -177,6 +177,11 @@ int get_free_deviceid(const char *name_template);
char *deviceid_from_spec_str(const char *str, char **endp);
static inline const char *dev_name(const struct device_d *dev)
{
return dev->name;
}
/* linear list over all available devices
*/
extern struct list_head device_list;
@ -238,7 +243,7 @@ static inline int dev_close_default(struct device_d *dev, struct filep *f)
extern const char *dev_id(const struct device_d *dev);
#define dev_printf(dev, format, arg...) \
printf("%s@%s: " format , (dev)->name , \
printf("%s@%s: " format , dev_name(dev) , \
dev_id(dev) , ## arg)
#define dev_emerg(dev, format, arg...) \