aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware/google
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 02:06:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 02:06:24 -0400
commitf0deb97ab13ad1f89cd0993f7339655d59788405 (patch)
tree41572e643cb4983115707ae330b5896ae76e1ea1 /drivers/firmware/google
parent184475029a724b6b900d88fc3a5f462a6107d5af (diff)
parent21d541aa19e90752232bf6c43002f019f204f988 (diff)
Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: updated Documentation/ja_JP/SubmittingPatches debugfs: add documentation for debugfs_create_x64 uio: uio_pdrv_genirq: Add OF support firmware: gsmi: remove sysfs entries when unload the module Documentation/zh_CN: Fix messy code file email-clients.txt driver core: add more help description for "path to uevent helper" driver-core: modify FIRMWARE_IN_KERNEL help message driver-core: Kconfig grammar corrections in firmware configuration DOCUMENTATION: Replace create_device() with device_create(). DOCUMENTATION: Update overview.txt in Doc/driver-model. pti: pti_tty_install documentation mispelling.
Diffstat (limited to 'drivers/firmware/google')
-rw-r--r--drivers/firmware/google/gsmi.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index fa7f0b3e81dd..68810fd1a59d 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -869,8 +869,6 @@ static __init int gsmi_init(void)
869 goto out_err; 869 goto out_err;
870 } 870 }
871 871
872 printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n");
873
874 /* Register in the firmware directory */ 872 /* Register in the firmware directory */
875 ret = -ENOMEM; 873 ret = -ENOMEM;
876 gsmi_kobj = kobject_create_and_add("gsmi", firmware_kobj); 874 gsmi_kobj = kobject_create_and_add("gsmi", firmware_kobj);
@@ -890,12 +888,13 @@ static __init int gsmi_init(void)
890 ret = sysfs_create_files(gsmi_kobj, gsmi_attrs); 888 ret = sysfs_create_files(gsmi_kobj, gsmi_attrs);
891 if (ret) { 889 if (ret) {
892 printk(KERN_INFO "gsmi: Failed to add attrs"); 890 printk(KERN_INFO "gsmi: Failed to add attrs");
893 goto out_err; 891 goto out_remove_bin_file;
894 } 892 }
895 893
896 if (register_efivars(&efivars, &efivar_ops, gsmi_kobj)) { 894 ret = register_efivars(&efivars, &efivar_ops, gsmi_kobj);
895 if (ret) {
897 printk(KERN_INFO "gsmi: Failed to register efivars\n"); 896 printk(KERN_INFO "gsmi: Failed to register efivars\n");
898 goto out_err; 897 goto out_remove_sysfs_files;
899 } 898 }
900 899
901 register_reboot_notifier(&gsmi_reboot_notifier); 900 register_reboot_notifier(&gsmi_reboot_notifier);
@@ -903,9 +902,15 @@ static __init int gsmi_init(void)
903 atomic_notifier_chain_register(&panic_notifier_list, 902 atomic_notifier_chain_register(&panic_notifier_list,
904 &gsmi_panic_notifier); 903 &gsmi_panic_notifier);
905 904
905 printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n");
906
906 return 0; 907 return 0;
907 908
908 out_err: 909out_remove_sysfs_files:
910 sysfs_remove_files(gsmi_kobj, gsmi_attrs);
911out_remove_bin_file:
912 sysfs_remove_bin_file(gsmi_kobj, &eventlog_bin_attr);
913out_err:
909 kobject_put(gsmi_kobj); 914 kobject_put(gsmi_kobj);
910 gsmi_buf_free(gsmi_dev.param_buf); 915 gsmi_buf_free(gsmi_dev.param_buf);
911 gsmi_buf_free(gsmi_dev.data_buf); 916 gsmi_buf_free(gsmi_dev.data_buf);
@@ -925,6 +930,8 @@ static void __exit gsmi_exit(void)
925 &gsmi_panic_notifier); 930 &gsmi_panic_notifier);
926 unregister_efivars(&efivars); 931 unregister_efivars(&efivars);
927 932
933 sysfs_remove_files(gsmi_kobj, gsmi_attrs);
934 sysfs_remove_bin_file(gsmi_kobj, &eventlog_bin_attr);
928 kobject_put(gsmi_kobj); 935 kobject_put(gsmi_kobj);
929 gsmi_buf_free(gsmi_dev.param_buf); 936 gsmi_buf_free(gsmi_dev.param_buf);
930 gsmi_buf_free(gsmi_dev.data_buf); 937 gsmi_buf_free(gsmi_dev.data_buf);