diff options
| author | Rajasekaran Kalidoss <rkalidos@codeaurora.org> | 2019-01-18 19:32:50 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-01-19 05:52:43 -0800 |
| commit | 94a480760a95ef32ac901b060056ecae1fc673ff (patch) | |
| tree | 0f00bb60ef52406c49de620304c8bc1888c1f366 /drivers | |
| parent | 66843b30eca6e599f7c4751e5740c082c56fd7ba (diff) | |
cnss2: Return 0 from susped/resume for driver_ops null
During usb suspend/resume call from USB SS, if driver
ops is not present cnss should return success. presently
it is returning -EINVAL if driver_ops is NULL.
Change-Id: I43a268489107bdad1945b4a842bb9ab3abe1b4ea
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/wireless/cnss2/usb.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/wireless/cnss2/usb.c b/drivers/net/wireless/cnss2/usb.c index 18915715edfd..ee9f21349c3f 100644 --- a/drivers/net/wireless/cnss2/usb.c +++ b/drivers/net/wireless/cnss2/usb.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -297,14 +297,11 @@ static int cnss_usb_suspend(struct usb_interface *interface, pm_message_t state) struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); usb_priv = plat_priv->bus_priv; - if (!usb_priv->driver_ops) { - cnss_pr_err("driver_ops is NULL\n"); - ret = -EINVAL; - goto out; - } - ret = usb_priv->driver_ops->suspend(usb_priv->usb_intf, - state); -out: + if (usb_priv->driver_ops) + ret = usb_priv->driver_ops->suspend(usb_priv->usb_intf, state); + else + cnss_pr_dbg("driver_ops is NULL\n"); + return ret; } @@ -315,14 +312,11 @@ static int cnss_usb_resume(struct usb_interface *interface) struct cnss_plat_data *plat_priv = cnss_bus_dev_to_plat_priv(NULL); usb_priv = plat_priv->bus_priv; - if (!usb_priv->driver_ops) { - cnss_pr_err("driver_ops is NULL\n"); - ret = -EINVAL; - goto out; - } - ret = usb_priv->driver_ops->resume(usb_priv->usb_intf); + if (usb_priv->driver_ops) + ret = usb_priv->driver_ops->resume(usb_priv->usb_intf); + else + cnss_pr_dbg("driver_ops is NULL\n"); -out: return ret; } |
