Exemple #1
0
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);
}
Exemple #2
0
static void gb_firmware_disconnect(struct gb_bundle *bundle)
{
	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);
}
Exemple #3
0
static void legacy_disconnect(struct gb_bundle *bundle)
{
	struct legacy_data *data = greybus_get_drvdata(bundle);
	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);
}
Exemple #4
0
static void gb_vibrator_disconnect(struct gb_bundle *bundle)
{
	struct gb_vibrator_device *vib = greybus_get_drvdata(bundle);
	int ret;

	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);
}
Exemple #5
0
static void gb_bootrom_disconnect(struct gb_bundle *bundle)
{
    struct gb_bootrom *bootrom = greybus_get_drvdata(bundle);

    dev_dbg(&bundle->dev, "%s\n", __func__);

    gb_connection_disable(bootrom->connection);

    /* 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);
}