Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6305df86 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: android: Fix synchronization between ffs_enable and ffs_close"

parents c0b024db c9e6173b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -631,15 +631,15 @@ static int functionfs_ready_callback(struct ffs_data *ffs)
	struct functionfs_config *config = ffs_function.config;
	int ret = 0;

	/* dev is null in case ADB is not in the composition */
	if (dev) {
		mutex_lock(&dev->mutex);
		ret = functionfs_bind(ffs, dev->cdev);
		if (ret)
		if (ret) {
			mutex_unlock(&dev->mutex);
			return ret;
		}

	/* dev is null in case ADB is not in the composition */
	if (dev)
		mutex_lock(&dev->mutex);
	}

	config->data = ffs;
	config->opened = true;
@@ -675,13 +675,13 @@ static void functionfs_closed_callback(struct ffs_data *ffs)

	config->dev = NULL;

	if (dev)
		mutex_unlock(&dev->mutex);

	config->opened = false;
	config->data = NULL;

	functionfs_unbind(ffs);

	if (dev)
		mutex_unlock(&dev->mutex);
}

static void *functionfs_acquire_dev_callback(const char *dev_name)