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

Commit 39fbb9de authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ADSPRPC: Substitute vfs check with flags"

parents 0ea61ea5 84e498fd
Loading
Loading
Loading
Loading
+7 −26
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
#include <linux/completion.h>
#include <linux/pagemap.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/cdev.h>
@@ -23,7 +22,6 @@
#include <soc/qcom/service-notifier.h>
#include <soc/qcom/service-locator.h>
#include <linux/scatterlist.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/device.h>
#include <linux/of.h>
@@ -2780,19 +2778,6 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
	return err;
}

static int fastrpc_kstat(const char *filename, struct kstat *stat)
{
	int result;
	mm_segment_t fs_old;

	fs_old = get_fs();
	set_fs(KERNEL_DS);
	result = vfs_stat((const char __user *)filename, stat);
	set_fs(fs_old);

	return result;
}

static int fastrpc_send_cpuinfo_to_dsp(struct fastrpc_file *fl)
{
	int err = 0;
@@ -2835,33 +2820,29 @@ static int fastrpc_get_info_from_dsp(struct fastrpc_file *fl,
	int err = 0, dsp_support = 0;
	struct fastrpc_ioctl_invoke_crc ioctl;
	remote_arg_t ra[2];
	struct kstat sb;
	struct fastrpc_apps *me = &gfa;

	// Querying device about DSP support
	switch (domain) {
	case ADSP_DOMAIN_ID:
		if (!fastrpc_kstat("/dev/subsys_adsp", &sb))
	case SDSP_DOMAIN_ID:
	case CDSP_DOMAIN_ID:
		if (me->channel[domain].issubsystemup)
			dsp_support = 1;
		break;
	case MDSP_DOMAIN_ID:
		//Modem not supported for fastRPC
		break;
	case SDSP_DOMAIN_ID:
		if (!fastrpc_kstat("/dev/subsys_slpi", &sb))
			dsp_support = 1;
		break;
	case CDSP_DOMAIN_ID:
		if (!fastrpc_kstat("/dev/subsys_cdsp", &sb))
			dsp_support = 1;
		break;
	default:
		dsp_support = 0;
		break;
	}
	dsp_attr_buf[0] = dsp_support;

	if (dsp_support == 0)
	if (dsp_support == 0) {
		err = -ENOTCONN;
		goto bail;
	}

	err = fastrpc_channel_open(fl);
	if (err)