Merge ../linux-2.6-watchdog-mm
[linux-drm-fsl-dcu.git] / drivers / firmware / efivars.c
index 343379f23a53cf432b98118c00e095b497aa6e6c..5ab5e393b882810556d80c6c7fa5071e444362b3 100644 (file)
@@ -66,7 +66,6 @@
  */
 
 #include <linux/capability.h>
-#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -568,20 +567,20 @@ systab_read(struct subsystem *entry, char *buf)
        if (!entry || !buf)
                return -EINVAL;
 
-       if (efi.mps)
-               str += sprintf(str, "MPS=0x%lx\n", __pa(efi.mps));
-       if (efi.acpi20)
-               str += sprintf(str, "ACPI20=0x%lx\n", __pa(efi.acpi20));
-       if (efi.acpi)
-               str += sprintf(str, "ACPI=0x%lx\n", __pa(efi.acpi));
-       if (efi.smbios)
-               str += sprintf(str, "SMBIOS=0x%lx\n", __pa(efi.smbios));
-       if (efi.hcdp)
-               str += sprintf(str, "HCDP=0x%lx\n", __pa(efi.hcdp));
-       if (efi.boot_info)
-               str += sprintf(str, "BOOTINFO=0x%lx\n", __pa(efi.boot_info));
-       if (efi.uga)
-               str += sprintf(str, "UGA=0x%lx\n", __pa(efi.uga));
+       if (efi.mps != EFI_INVALID_TABLE_ADDR)
+               str += sprintf(str, "MPS=0x%lx\n", efi.mps);
+       if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+               str += sprintf(str, "ACPI20=0x%lx\n", efi.acpi20);
+       if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+               str += sprintf(str, "ACPI=0x%lx\n", efi.acpi);
+       if (efi.smbios != EFI_INVALID_TABLE_ADDR)
+               str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
+       if (efi.hcdp != EFI_INVALID_TABLE_ADDR)
+               str += sprintf(str, "HCDP=0x%lx\n", efi.hcdp);
+       if (efi.boot_info != EFI_INVALID_TABLE_ADDR)
+               str += sprintf(str, "BOOTINFO=0x%lx\n", efi.boot_info);
+       if (efi.uga != EFI_INVALID_TABLE_ADDR)
+               str += sprintf(str, "UGA=0x%lx\n", efi.uga);
 
        return str - buf;
 }
@@ -640,7 +639,12 @@ efivar_create_sysfs_entry(unsigned long variable_name_size,
 
        kobject_set_name(&new_efivar->kobj, "%s", short_name);
        kobj_set_kset_s(new_efivar, vars_subsys);
-       kobject_register(&new_efivar->kobj);
+       i = kobject_register(&new_efivar->kobj);
+       if (i) {
+               kfree(short_name);
+               kfree(new_efivar);
+               return 1;
+       }
 
        kfree(short_name);
        short_name = NULL;