summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/google
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 23:06:24 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 23:06:24 -0700
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 fa7f0b3e81d..68810fd1a59 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -869,8 +869,6 @@ static __init int gsmi_init(void)
goto out_err;
}
- printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n");
-
/* Register in the firmware directory */
ret = -ENOMEM;
gsmi_kobj = kobject_create_and_add("gsmi", firmware_kobj);
@@ -890,12 +888,13 @@ static __init int gsmi_init(void)
ret = sysfs_create_files(gsmi_kobj, gsmi_attrs);
if (ret) {
printk(KERN_INFO "gsmi: Failed to add attrs");
- goto out_err;
+ goto out_remove_bin_file;
}
- if (register_efivars(&efivars, &efivar_ops, gsmi_kobj)) {
+ ret = register_efivars(&efivars, &efivar_ops, gsmi_kobj);
+ if (ret) {
printk(KERN_INFO "gsmi: Failed to register efivars\n");
- goto out_err;
+ goto out_remove_sysfs_files;
}
register_reboot_notifier(&gsmi_reboot_notifier);
@@ -903,9 +902,15 @@ static __init int gsmi_init(void)
atomic_notifier_chain_register(&panic_notifier_list,
&gsmi_panic_notifier);
+ printk(KERN_INFO "gsmi version " DRIVER_VERSION " loaded\n");
+
return 0;
- out_err:
+out_remove_sysfs_files:
+ sysfs_remove_files(gsmi_kobj, gsmi_attrs);
+out_remove_bin_file:
+ sysfs_remove_bin_file(gsmi_kobj, &eventlog_bin_attr);
+out_err:
kobject_put(gsmi_kobj);
gsmi_buf_free(gsmi_dev.param_buf);
gsmi_buf_free(gsmi_dev.data_buf);
@@ -925,6 +930,8 @@ static void __exit gsmi_exit(void)
&gsmi_panic_notifier);
unregister_efivars(&efivars);
+ sysfs_remove_files(gsmi_kobj, gsmi_attrs);
+ sysfs_remove_bin_file(gsmi_kobj, &eventlog_bin_attr);
kobject_put(gsmi_kobj);
gsmi_buf_free(gsmi_dev.param_buf);
gsmi_buf_free(gsmi_dev.data_buf);