On Fri, Jul 15, 2011 at 10:46:23AM -0700, K. Y. Srinivasan wrote:
> To support "human readable" sysfs attribute, introduce a function to map the
> dev_type guid to a string.
> 
> Signed-off-by: K. Y. Srinivasan <k...@microsoft.com>
> Signed-off-by: Haiyang Zhang <haiya...@microsoft.com>
> ---
>  drivers/staging/hv/channel_mgmt.c |   36 ++++++++++++++++++++++++++++++++++++
>  drivers/staging/hv/hyperv.h       |    2 +-
>  2 files changed, 37 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/hv/channel_mgmt.c 
> b/drivers/staging/hv/channel_mgmt.c
> index 11beb41..926bc87 100644
> --- a/drivers/staging/hv/channel_mgmt.c
> +++ b/drivers/staging/hv/channel_mgmt.c
> @@ -112,6 +112,42 @@ static const uuid_le
>  
>  };
>  
> +static const char *blk_dev_type = "hv_block";
> +static const char *net_dev_type = "hv_net";
> +static const char *scsi_dev_type = "hv_scsi";
> +static const char *mouse_dev_type = "hv_mouse";
> +static const char *util_dev_type = "hv_util";

Ick, no.  There should never be any type of "central" knowledge of the
different driver names or types like this.  It should all be
self-contained within the individual drivers.

You will note that no other bus type has this type of thing, which
should have been a hint that you should not have done this...

greg k-h
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization

Reply via email to