mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
cnss2: Group dev_boot debugfs handling by contexts
To handle dev_boot debugfs, group the API calls based on contexts to avoid exiting because of irrelevant invalid context. Change-Id: I3d031ca53fc2739ae4947a40c4b3b0e7f7a74bb3 Signed-off-by: Yue Ma <yuem@codeaurora.org>
This commit is contained in:
parent
a8aba15775
commit
130ead3ce6
1 changed files with 13 additions and 11 deletions
|
|
@ -171,10 +171,6 @@ static ssize_t cnss_dev_boot_debug_write(struct file *fp,
|
|||
if (!plat_priv)
|
||||
return -ENODEV;
|
||||
|
||||
pci_priv = plat_priv->bus_priv;
|
||||
if (!pci_priv)
|
||||
return -ENODEV;
|
||||
|
||||
len = min(count, sizeof(buf) - 1);
|
||||
if (copy_from_user(buf, user_buf, len))
|
||||
return -EFAULT;
|
||||
|
|
@ -189,13 +185,6 @@ static ssize_t cnss_dev_boot_debug_write(struct file *fp,
|
|||
cnss_power_off_device(plat_priv);
|
||||
} else if (sysfs_streq(cmd, "enumerate")) {
|
||||
ret = cnss_pci_init(plat_priv);
|
||||
} else if (sysfs_streq(cmd, "download")) {
|
||||
set_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state);
|
||||
ret = cnss_pci_start_mhi(pci_priv);
|
||||
} else if (sysfs_streq(cmd, "linkup")) {
|
||||
ret = cnss_resume_pci_link(pci_priv);
|
||||
} else if (sysfs_streq(cmd, "linkdown")) {
|
||||
ret = cnss_suspend_pci_link(pci_priv);
|
||||
} else if (sysfs_streq(cmd, "powerup")) {
|
||||
set_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state);
|
||||
ret = cnss_driver_event_post(plat_priv,
|
||||
|
|
@ -206,6 +195,19 @@ static ssize_t cnss_dev_boot_debug_write(struct file *fp,
|
|||
CNSS_DRIVER_EVENT_POWER_DOWN,
|
||||
0, NULL);
|
||||
clear_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state);
|
||||
}
|
||||
|
||||
pci_priv = plat_priv->bus_priv;
|
||||
if (!pci_priv)
|
||||
return -ENODEV;
|
||||
|
||||
if (sysfs_streq(cmd, "download")) {
|
||||
set_bit(CNSS_DRIVER_DEBUG, &plat_priv->driver_state);
|
||||
ret = cnss_pci_start_mhi(pci_priv);
|
||||
} else if (sysfs_streq(cmd, "linkup")) {
|
||||
ret = cnss_resume_pci_link(pci_priv);
|
||||
} else if (sysfs_streq(cmd, "linkdown")) {
|
||||
ret = cnss_suspend_pci_link(pci_priv);
|
||||
} else if (sysfs_streq(cmd, "assert")) {
|
||||
cnss_pr_info("FW Assert triggered for debug\n");
|
||||
ret = cnss_force_fw_assert(&pci_priv->pci_dev->dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue