diff options
-rw-r--r-- | sound/pci/hda/hda_local.h | 7 | ||||
-rw-r--r-- | sound/pci/hda/hda_proc.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index e1abc07f7436..aca8d3193b95 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h | |||
@@ -488,7 +488,12 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) | |||
488 | } | 488 | } |
489 | 489 | ||
490 | /* get the widget type from widget capability bits */ | 490 | /* get the widget type from widget capability bits */ |
491 | #define get_wcaps_type(wcaps) (((wcaps) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT) | 491 | static inline int get_wcaps_type(unsigned int wcaps) |
492 | { | ||
493 | if (!wcaps) | ||
494 | return -1; /* invalid type */ | ||
495 | return (wcaps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | ||
496 | } | ||
492 | 497 | ||
493 | static inline unsigned int get_wcaps_channels(u32 wcaps) | 498 | static inline unsigned int get_wcaps_channels(u32 wcaps) |
494 | { | 499 | { |
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 2c981b55940b..254ab5204603 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -54,6 +54,8 @@ static const char *get_wid_type_name(unsigned int wid_value) | |||
54 | [AC_WID_BEEP] = "Beep Generator Widget", | 54 | [AC_WID_BEEP] = "Beep Generator Widget", |
55 | [AC_WID_VENDOR] = "Vendor Defined Widget", | 55 | [AC_WID_VENDOR] = "Vendor Defined Widget", |
56 | }; | 56 | }; |
57 | if (wid_value == -1) | ||
58 | return "UNKNOWN Widget"; | ||
57 | wid_value &= 0xf; | 59 | wid_value &= 0xf; |
58 | if (names[wid_value]) | 60 | if (names[wid_value]) |
59 | return names[wid_value]; | 61 | return names[wid_value]; |