diff options
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/efi/efi.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 023937a63a48..ac88ec05eb70 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c | |||
@@ -104,16 +104,19 @@ static struct attribute *efi_subsys_attrs[] = { | |||
104 | static umode_t efi_attr_is_visible(struct kobject *kobj, | 104 | static umode_t efi_attr_is_visible(struct kobject *kobj, |
105 | struct attribute *attr, int n) | 105 | struct attribute *attr, int n) |
106 | { | 106 | { |
107 | umode_t mode = attr->mode; | 107 | if (attr == &efi_attr_fw_vendor.attr) { |
108 | 108 | if (efi_enabled(EFI_PARAVIRT) || | |
109 | if (attr == &efi_attr_fw_vendor.attr) | 109 | efi.fw_vendor == EFI_INVALID_TABLE_ADDR) |
110 | return (efi.fw_vendor == EFI_INVALID_TABLE_ADDR) ? 0 : mode; | 110 | return 0; |
111 | else if (attr == &efi_attr_runtime.attr) | 111 | } else if (attr == &efi_attr_runtime.attr) { |
112 | return (efi.runtime == EFI_INVALID_TABLE_ADDR) ? 0 : mode; | 112 | if (efi.runtime == EFI_INVALID_TABLE_ADDR) |
113 | else if (attr == &efi_attr_config_table.attr) | 113 | return 0; |
114 | return (efi.config_table == EFI_INVALID_TABLE_ADDR) ? 0 : mode; | 114 | } else if (attr == &efi_attr_config_table.attr) { |
115 | if (efi.config_table == EFI_INVALID_TABLE_ADDR) | ||
116 | return 0; | ||
117 | } | ||
115 | 118 | ||
116 | return mode; | 119 | return attr->mode; |
117 | } | 120 | } |
118 | 121 | ||
119 | static struct attribute_group efi_subsys_attr_group = { | 122 | static struct attribute_group efi_subsys_attr_group = { |