Commit b31d8b90 authored by David Woodhouse's avatar David Woodhouse Committed by David S. Miller

libertas: remove pre_open_check()

The firmware is always initialised before we register the netdevices.
It's not possible for pre_open_check() to fail.

One day we might try loading firmware in ->open(), but still it won't be
just a _check_, like this.
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 14e865ba
...@@ -366,34 +366,6 @@ static struct attribute_group lbs_mesh_attr_group = { ...@@ -366,34 +366,6 @@ static struct attribute_group lbs_mesh_attr_group = {
.attrs = lbs_mesh_sysfs_entries, .attrs = lbs_mesh_sysfs_entries,
}; };
/**
* @brief Check if the device can be open and wait if necessary.
*
* @param dev A pointer to net_device structure
* @return 0
*
* For USB adapter, on some systems the device open handler will be
* called before FW ready. Use the following flag check and wait
* function to work around the issue.
*
*/
static int pre_open_check(struct net_device *dev)
{
struct lbs_private *priv = (struct lbs_private *) dev->priv;
int i = 0;
while (!priv->fw_ready && i < 20) {
i++;
msleep_interruptible(100);
}
if (!priv->fw_ready) {
lbs_pr_err("firmware not ready\n");
return -1;
}
return 0;
}
/** /**
* @brief This function opens the device * @brief This function opens the device
* *
...@@ -433,8 +405,6 @@ static int lbs_mesh_open(struct net_device *dev) ...@@ -433,8 +405,6 @@ static int lbs_mesh_open(struct net_device *dev)
{ {
struct lbs_private *priv = (struct lbs_private *) dev->priv ; struct lbs_private *priv = (struct lbs_private *) dev->priv ;
if (pre_open_check(dev) == -1)
return -1;
priv->mesh_open = 1 ; priv->mesh_open = 1 ;
netif_wake_queue(priv->mesh_dev); netif_wake_queue(priv->mesh_dev);
...@@ -457,8 +427,6 @@ static int lbs_open(struct net_device *dev) ...@@ -457,8 +427,6 @@ static int lbs_open(struct net_device *dev)
{ {
struct lbs_private *priv = (struct lbs_private *) dev->priv ; struct lbs_private *priv = (struct lbs_private *) dev->priv ;
if(pre_open_check(dev) == -1)
return -1;
priv->infra_open = 1 ; priv->infra_open = 1 ;
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
if (priv->open == 0) if (priv->open == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment