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

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

Merge "msm: rndis_ipa: fix to debug file system init failure"

parents 29c858c8 0948cf59
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ static netdev_tx_t ecm_ipa_start_xmit(struct sk_buff *skb,
static int ecm_ipa_debugfs_atomic_open(struct inode *inode, struct file *file);
static ssize_t ecm_ipa_debugfs_atomic_read(struct file *file,
		char __user *ubuf, size_t count, loff_t *ppos);
static int ecm_ipa_debugfs_init(struct ecm_ipa_dev *ecm_ipa_ctx);
static void ecm_ipa_debugfs_init(struct ecm_ipa_dev *ecm_ipa_ctx);
static void ecm_ipa_debugfs_destroy(struct ecm_ipa_dev *ecm_ipa_ctx);
static int ecm_ipa_ep_registers_cfg(u32 usb_to_ipa_hdl, u32 ipa_to_usb_hdl);
static int ecm_ipa_set_device_ethernet_addr(u8 *dev_ethaddr,
@@ -262,10 +262,7 @@ int ecm_ipa_init(struct ecm_ipa_params *params)
		ECM_IPA_DEBUG("device_ready_notify() was not supplied");
	ecm_ipa_ctx->device_ready_notify = params->device_ready_notify;

	result = ecm_ipa_debugfs_init(ecm_ipa_ctx);
	if (result)
		goto fail_debugfs;
	ECM_IPA_DEBUG("debugfs entries were created\n");
	ecm_ipa_debugfs_init(ecm_ipa_ctx);

	result = ecm_ipa_set_device_ethernet_addr(net->dev_addr,
			params->device_ethaddr);
@@ -314,7 +311,6 @@ fail_register_netdev:
fail_set_device_ethernet:
fail_rules_cfg:
	ecm_ipa_debugfs_destroy(ecm_ipa_ctx);
fail_debugfs:
fail_netdev_priv:
	free_netdev(net);
fail_alloc_etherdev:
@@ -1201,8 +1197,9 @@ static ssize_t ecm_ipa_debugfs_atomic_read(struct file *file,
	return simple_read_from_buffer(ubuf, count, ppos, atomic_str, nbytes);
}

#ifdef CONFIG_DEBUG_FS

static int ecm_ipa_debugfs_init(struct ecm_ipa_dev *ecm_ipa_ctx)
static void ecm_ipa_debugfs_init(struct ecm_ipa_dev *ecm_ipa_ctx)
{
	const mode_t flags_read_write = S_IRUGO | S_IWUGO;
	const mode_t flags_read_only = S_IRUGO;
@@ -1211,7 +1208,7 @@ static int ecm_ipa_debugfs_init(struct ecm_ipa_dev *ecm_ipa_ctx)
	ECM_IPA_LOG_ENTRY();

	if (!ecm_ipa_ctx)
		return -EINVAL;
		return;

	ecm_ipa_ctx->directory = debugfs_create_dir("ecm_ipa", NULL);
	if (!ecm_ipa_ctx->directory) {
@@ -1241,11 +1238,11 @@ static int ecm_ipa_debugfs_init(struct ecm_ipa_dev *ecm_ipa_ctx)
	ECM_IPA_DEBUG("debugfs entries were created\n");
	ECM_IPA_LOG_EXIT();

	return 0;
	return;
fail_file:
	debugfs_remove_recursive(ecm_ipa_ctx->directory);
fail_directory:
	return -EFAULT;
	return;
}

static void ecm_ipa_debugfs_destroy(struct ecm_ipa_dev *ecm_ipa_ctx)
@@ -1253,6 +1250,14 @@ static void ecm_ipa_debugfs_destroy(struct ecm_ipa_dev *ecm_ipa_ctx)
	debugfs_remove_recursive(ecm_ipa_ctx->directory);
}

#else /* !CONFIG_DEBUG_FS*/

static void ecm_ipa_debugfs_init(struct ecm_ipa_dev *ecm_ipa_ctx) {}

static void ecm_ipa_debugfs_destroy(struct ecm_ipa_dev *ecm_ipa_ctx) {}

#endif /* CONFIG_DEBUG_FS */

/**
 * ecm_ipa_ep_cfg() - configure the USB endpoints for ECM
 *
+15 −10
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ static ssize_t rndis_ipa_debugfs_aggr_write(struct file *file,
static ssize_t rndis_ipa_debugfs_atomic_read(struct file *file,
		char __user *ubuf, size_t count, loff_t *ppos);
static void rndis_ipa_dump_skb(struct sk_buff *skb);
static int rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx);
static void rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx);
static void rndis_ipa_debugfs_destroy(struct rndis_ipa_dev *rndis_ipa_ctx);
static int rndis_ipa_ep_registers_cfg(u32 usb_to_ipa_hdl,
		u32 ipa_to_usb_hdl, u32 max_xfer_size_bytes_to_dev,
@@ -542,10 +542,7 @@ int rndis_ipa_init(struct ipa_usb_init_params *params)
	RNDIS_IPA_DEBUG("Needed headroom for RNDIS header set to %d\n",
		net->needed_headroom);

	result = rndis_ipa_debugfs_init(rndis_ipa_ctx);
	if (result)
		goto fail_debugfs;
	RNDIS_IPA_DEBUG("debugfs entries were created\n");
	rndis_ipa_debugfs_init(rndis_ipa_ctx);

	result = rndis_ipa_set_device_ethernet_addr(net->dev_addr,
			rndis_ipa_ctx->device_ethaddr);
@@ -602,7 +599,6 @@ fail_register_tx:
fail_set_device_ethernet:
fail_hdrs_cfg:
	rndis_ipa_debugfs_destroy(rndis_ipa_ctx);
fail_debugfs:
fail_netdev_priv:
	free_netdev(net);
fail_alloc_etherdev:
@@ -2065,10 +2061,11 @@ static void rndis_ipa_dump_skb(struct sk_buff *skb)
		skb->len);
}

#ifdef CONFIG_DEBUG_FS
/**
 * Creates the root folder for the driver
 */
static int rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
static void rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
{
	const mode_t flags_read_write = S_IRUGO | S_IWUGO;
	const mode_t flags_read_only = S_IRUGO;
@@ -2079,7 +2076,7 @@ static int rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
	RNDIS_IPA_LOG_ENTRY();

	if (!rndis_ipa_ctx)
		return -EINVAL;
		return;

	rndis_ipa_ctx->directory = debugfs_create_dir(DEBUGFS_DIR_NAME, NULL);
	if (!rndis_ipa_ctx->directory) {
@@ -2253,13 +2250,14 @@ static int rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx)
		goto fail_file;
	}

	RNDIS_IPA_DEBUG("debugfs entries were created\n");
	RNDIS_IPA_LOG_EXIT();

	return 0;
	return;
fail_file:
	debugfs_remove_recursive(rndis_ipa_ctx->directory);
fail_directory:
	return -EFAULT;
	return;
}

static void rndis_ipa_debugfs_destroy(struct rndis_ipa_dev *rndis_ipa_ctx)
@@ -2267,6 +2265,13 @@ static void rndis_ipa_debugfs_destroy(struct rndis_ipa_dev *rndis_ipa_ctx)
	debugfs_remove_recursive(rndis_ipa_ctx->directory);
}

#else /* !CONFIG_DEBUG_FS */

static void rndis_ipa_debugfs_init(struct rndis_ipa_dev *rndis_ipa_ctx) {}

static void rndis_ipa_debugfs_destroy(struct rndis_ipa_dev *rndis_ipa_ctx) {}

#endif /* CONFIG_DEBUG_FS*/

static int rndis_ipa_debugfs_aggr_open(struct inode *inode,
		struct file *file)