static void __exit lenovo_sl_laptop_exit(void) { lenovo_sl_procfs_exit(); hwmon_exit(); hkey_poll_stop(); led_exit(); radio_exit(LENSL_UWB); radio_exit(LENSL_WWAN); radio_exit(LENSL_BLUETOOTH); hkey_inputdev_exit(); if (lensl_pdev) platform_device_unregister(lensl_pdev); destroy_workqueue(lensl_wq); vdbg_printk(LENSL_INFO, "Unloaded Lenovo ThinkPad SL Series driver\n"); }
static int radio_init(lensl_radio_type type) { int value, res, hw_blocked = 0, sw_blocked; if (!hkey_handle) return -ENODEV; lensl_radios[type].present = 1; /* need for lensl_radio_get */ res = lensl_radio_get(&lensl_radios[type], &hw_blocked, &value); lensl_radios[type].present = 0; if (res && !hw_blocked) return -EIO; if (!(value & LENSL_RADIO_HWPRESENT)) return -ENODEV; lensl_radios[type].present = 1; if (*lensl_radios[type].auto_enable) { sw_blocked = 0; value |= LENSL_RADIO_RADIOSSW; lensl_radios[type].set_acpi(value); } else { sw_blocked = 1; value &= ~LENSL_RADIO_RADIOSSW; lensl_radios[type].set_acpi(value); } res = lensl_radio_new_rfkill(&lensl_radios[type], &lensl_radios[type].rfk, sw_blocked, hw_blocked); if (res) { radio_exit(type); return res; } vdbg_printk(LENSL_DEBUG, "Initialized %s subdriver\n", lensl_radios[type].name); return 0; }