diff options
author | Utkarsh Saxena <usaxena@codeaurora.org> | 2016-10-17 16:10:11 +0530 |
---|---|---|
committer | Utkarsh Saxena <usaxena@codeaurora.org> | 2017-02-09 21:15:20 +0530 |
commit | 0948cf59f9928bec075c807dc7b633fd6973922d (patch) | |
tree | 518c759557a54e99d3d0d14424f89db2226b76c5 /drivers/net | |
parent | d24550bbf50f61b07668a28a20878e1f91cf544c (diff) |
msm: rndis_ipa: fix to debug file system init failure
Do not consider debug file system init failure as
functional failure.
Modify the code to proceed further
driver initialization.
Change-Id: I821af8970b6c2ced55d6464b8a7b56a458fa7d79
Acked-by: Javid Mohammed <mjavid@qti.qualcomm.com>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/msm/ecm_ipa.c | 25 | ||||
-rw-r--r-- | drivers/net/ethernet/msm/rndis_ipa.c | 25 |
2 files changed, 30 insertions, 20 deletions
diff --git a/drivers/net/ethernet/msm/ecm_ipa.c b/drivers/net/ethernet/msm/ecm_ipa.c index 0f25932d8855..a89face0e891 100644 --- a/drivers/net/ethernet/msm/ecm_ipa.c +++ b/drivers/net/ethernet/msm/ecm_ipa.c @@ -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 * diff --git a/drivers/net/ethernet/msm/rndis_ipa.c b/drivers/net/ethernet/msm/rndis_ipa.c index 62e72ca01929..78ec72dd3442 100644 --- a/drivers/net/ethernet/msm/rndis_ipa.c +++ b/drivers/net/ethernet/msm/rndis_ipa.c @@ -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) |