[PATCH] driver: add dev_name inline

Sascha Hauer s.hauer at pengutronix.de
Mon Nov 2 02:32:34 EST 2009


On Fri, Oct 30, 2009 at 10:55:23PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> ---
>  include/driver.h |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)

applied

Sascha

> 
> diff --git a/include/driver.h b/include/driver.h
> index 2ee7fb1..91a3aaa 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...)		\
> -- 
> 1.6.5
> 
> 
> _______________________________________________
> u-boot-v2 mailing list
> u-boot-v2 at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/u-boot-v2
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the u-boot-v2 mailing list