static int __exit hp_wmi_bios_remove(struct platform_device *device) { int i; cleanup_sysfs(device); for (i = 0; i < rfkill2_count; i++) { rfkill_unregister(rfkill2[i].rfkill); rfkill_destroy(rfkill2[i].rfkill); } if (wifi_rfkill) { rfkill_unregister(wifi_rfkill); rfkill_destroy(wifi_rfkill); } if (bluetooth_rfkill) { rfkill_unregister(bluetooth_rfkill); rfkill_destroy(bluetooth_rfkill); } if (wwan_rfkill) { rfkill_unregister(wwan_rfkill); rfkill_destroy(wwan_rfkill); } return 0; }
static int __init hp_wmi_bios_setup(struct platform_device *device) { int err; /* clear detected rfkill devices */ wifi_rfkill = NULL; bluetooth_rfkill = NULL; wwan_rfkill = NULL; rfkill2_count = 0; if (hp_wmi_rfkill_setup(device)) hp_wmi_rfkill2_setup(device); err = device_create_file(&device->dev, &dev_attr_display); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_hddtemp); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_als); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_dock); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_tablet); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_postcode); if (err) goto add_sysfs_error; return 0; add_sysfs_error: cleanup_sysfs(device); return err; }
static int __exit fwdt_remove(struct platform_device *device) { cleanup_sysfs(device); return 0; }
static int fwdt_setup(struct platform_device *device) { int err; acpi_status status; err = device_create_file(&device->dev, &dev_attr_acpi_method); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_acpi_arg0); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_acpi_method_1_1); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_acpi_method_0_1); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_acpi_method_0_0); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_video_device); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_video_brightness); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_mem_address); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_mem_data); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_iow_address); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_iow_data); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_iob_address); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_iob_data); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_pci_id); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_pci_reg); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_pci_data); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_cmos); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_msr); if (err) goto add_sysfs_error; status = acpi_get_devices("PNP0C09", acpi_handle_locate_callback, NULL, &ec_device); if (ACPI_SUCCESS(status)) { if (!ec_device) goto add_sysfs_done; err = device_create_file(&device->dev, &dev_attr_ec_address); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_ec_data); if (err) goto add_sysfs_error; err = device_create_file(&device->dev, &dev_attr_ec_qmethod); if (err) goto add_sysfs_error; } add_sysfs_done: return 0; add_sysfs_error: cleanup_sysfs(device); return err; }