diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2009-10-30 22:55:23 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-11-02 08:23:45 +0100 |
commit | 483d4e08575b6731f4c913b9709fdbe94223f388 (patch) | |
tree | 3e5bd70ab1bdea6e2b05fb5af3ce5b21578c6f7f /include | |
parent | 318e743323beb6c965e24ce5c176dd6aea0347c3 (diff) | |
download | barebox-483d4e08575b6731f4c913b9709fdbe94223f388.tar.gz barebox-483d4e08575b6731f4c913b9709fdbe94223f388.tar.xz |
driver: add dev_name inline
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/driver.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/driver.h b/include/driver.h index 2ee7fb1cf8..91a3aaa886 100644 --- a/include/driver.h +++ b/include/driver.h @@ -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...) \ |