ret = gb_pm_runtime_get_sync(bundle); if (ret) gb_pm_runtime_get_noresume(bundle); if (cancel_delayed_work_sync(&vib->delayed_work)) turn_off(vib); device_unregister(vib->dev); ida_simple_remove(&minors, vib->minor); gb_connection_disable(vib->connection); gb_connection_destroy(vib->connection); kfree(vib); } static const struct greybus_bundle_id gb_vibrator_id_table[] = { { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_VIBRATOR) }, { } }; MODULE_DEVICE_TABLE(greybus, gb_vibrator_id_table); static struct greybus_driver gb_vibrator_driver = { .name = "vibrator", .probe = gb_vibrator_probe, .disconnect = gb_vibrator_disconnect, .id_table = gb_vibrator_id_table, }; static __init int gb_vibrator_init(void) { int retval;
struct gb_firmware *firmware = greybus_get_drvdata(bundle); dev_dbg(&bundle->dev, "%s\n", __func__); gb_connection_disable(firmware->connection); /* Release firmware */ if (firmware->fw) free_firmware(firmware); gb_connection_destroy(firmware->connection); kfree(firmware); } static const struct greybus_bundle_id gb_firmware_id_table[] = { { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_FIRMWARE) }, { } }; static struct greybus_driver gb_firmware_driver = { .name = "firmware", .probe = gb_firmware_probe, .disconnect = gb_firmware_disconnect, .id_table = gb_firmware_id_table, }; int gb_firmware_init(void) { return greybus_register(&gb_firmware_driver); }
int i; dev_dbg(&bundle->dev, "%s - bundle class = 0x%02x\n", __func__, bundle->class); for (i = 0; i < data->num_cports; ++i) { legacy_connection_exit(&data->connections[i]); legacy_connection_destroy(&data->connections[i]); } kfree(data->connections); kfree(data); } static const struct greybus_bundle_id legacy_id_table[] = { { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_GPIO) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_I2C) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_UART) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_USB) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_SDIO) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_POWER_SUPPLY) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_PWM) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_SPI) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_CAMERA) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_LIGHTS) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_LOOPBACK) }, { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_RAW) }, { } }; MODULE_DEVICE_TABLE(greybus, legacy_id_table);
/* Disable timeouts */ gb_bootrom_cancel_timeout(bootrom); /* * Release firmware: * * As the connection and the delayed work are already disabled, we don't * need to lock access to bootrom->fw here. */ free_firmware(bootrom); gb_connection_destroy(bootrom->connection); kfree(bootrom); } static const struct greybus_bundle_id gb_bootrom_id_table[] = { { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_BOOTROM) }, { } }; static struct greybus_driver gb_bootrom_driver = { .name = "bootrom", .probe = gb_bootrom_probe, .disconnect = gb_bootrom_disconnect, .id_table = gb_bootrom_id_table, }; module_greybus_driver(gb_bootrom_driver); MODULE_LICENSE("GPL v2");
} static void gb_lights_disconnect(struct gb_bundle *bundle) { struct gb_lights *glights = greybus_get_drvdata(bundle); if (gb_pm_runtime_get_sync(bundle)) gb_pm_runtime_get_noresume(bundle); gb_connection_disable(glights->connection); gb_connection_destroy(glights->connection); gb_lights_release(glights); } static const struct greybus_bundle_id gb_lights_id_table[] = { { GREYBUS_DEVICE_CLASS(GREYBUS_CLASS_LIGHTS) }, { } }; MODULE_DEVICE_TABLE(greybus, gb_lights_id_table); static struct greybus_driver gb_lights_driver = { .name = "lights", .probe = gb_lights_probe, .disconnect = gb_lights_disconnect, .id_table = gb_lights_id_table, }; module_greybus_driver(gb_lights_driver); MODULE_LICENSE("GPL v2");