Skip to content

Commit

Permalink
caif-hsi: Fix merge issues.
Browse files Browse the repository at this point in the history
Fix the failing merge in net-next by reverting the last
net-next merge for caif_hsi.c and then merge in the commit:
"caif-hsi: Bugfix - Piggyback'ed embedded CAIF frame lost"
from the net repository.

The commit:"caif-hsi: Add missing return in error path" from
net repository was dropped, as it changed code previously removed in the
net-next repository.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sjur Brændeland authored and David S. Miller committed Jun 29, 2012
1 parent 3085a4b commit 7fa8ad6
Showing 1 changed file with 27 additions and 45 deletions.
72 changes: 27 additions & 45 deletions drivers/net/caif/caif_hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,51 +1131,7 @@ static void cfhsi_setup(struct net_device *dev)
cfhsi->cfdev.use_stx = false;
cfhsi->cfdev.use_fcs = false;
cfhsi->ndev = dev;
}

int cfhsi_probe(struct platform_device *pdev)
{
struct cfhsi_ops *(*get_ops)(void);
struct cfhsi *cfhsi = NULL;
struct net_device *ndev;
int res;

ndev = alloc_netdev(sizeof(struct cfhsi), "cfhsi%d", cfhsi_setup);
if (!ndev)
return -ENODEV;

cfhsi = netdev_priv(ndev);
cfhsi->ndev = ndev;
cfhsi->pdev = pdev;

get_ops = symbol_get(cfhsi_get_ops);
if (!get_ops) {
pr_err("%s: failed to get the cfhsi_ops\n", __func__);
return -ENODEV;
}

/* Assign the HSI device. */
cfhsi->ops = (*get_ops)();
if (!cfhsi->ops) {
pr_err("%s: failed to get the cfhsi_ops\n", __func__);
goto err;
}

/* Assign the driver to this HSI device. */
cfhsi->ops->cb_ops = &cfhsi->cb_ops;
res = register_netdevice(ndev);
if (res) {
dev_err(&ndev->dev, "%s: Registration error: %d.\n",
__func__, res);
free_netdev(ndev);
}
/* Add CAIF HSI device to list. */
list_add_tail(&cfhsi->list, &cfhsi_list);

return res;
err:
symbol_put(cfhsi_get_ops);
return -ENODEV;
cfhsi->cfg = hsi_default_config;
}

static int cfhsi_open(struct net_device *ndev)
Expand Down Expand Up @@ -1454,14 +1410,40 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[])
{
struct cfhsi *cfhsi = NULL;
struct cfhsi_ops *(*get_ops)(void);

ASSERT_RTNL();

cfhsi = netdev_priv(dev);
cfhsi_netlink_parms(data, cfhsi);
dev_net_set(cfhsi->ndev, src_net);

get_ops = symbol_get(cfhsi_get_ops);
if (!get_ops) {
pr_err("%s: failed to get the cfhsi_ops\n", __func__);
return -ENODEV;
}

/* Assign the HSI device. */
cfhsi->ops = (*get_ops)();
if (!cfhsi->ops) {
pr_err("%s: failed to get the cfhsi_ops\n", __func__);
goto err;
}

/* Assign the driver to this HSI device. */
cfhsi->ops->cb_ops = &cfhsi->cb_ops;
if (register_netdevice(dev)) {
pr_warn("%s: caif_hsi device registration failed\n", __func__);
goto err;
}
/* Add CAIF HSI device to list. */
list_add_tail(&cfhsi->list, &cfhsi_list);

return 0;
err:
symbol_put(cfhsi_get_ops);
return -ENODEV;
}

static struct rtnl_link_ops caif_hsi_link_ops __read_mostly = {
Expand Down

0 comments on commit 7fa8ad6

Please sign in to comment.