diff options
author | Sjur Brændeland <sjur.brandeland@stericsson.com> | 2012-06-28 16:36:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-29 03:46:53 -0400 |
commit | 7fa8ad6df71f4778b23e17b0106aaef02b518684 (patch) | |
tree | 0a3fceb23fd842e13a81f21b436bc68995467356 /drivers/net/caif | |
parent | 3085a4b7d33eb3111244173d1383256e94d249a5 (diff) |
caif-hsi: Fix merge issues.
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>
Diffstat (limited to 'drivers/net/caif')
-rw-r--r-- | drivers/net/caif/caif_hsi.c | 72 |
1 files changed, 27 insertions, 45 deletions
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c index 087eb83454c0..0def8b3106f4 100644 --- a/drivers/net/caif/caif_hsi.c +++ b/drivers/net/caif/caif_hsi.c | |||
@@ -1131,51 +1131,7 @@ static void cfhsi_setup(struct net_device *dev) | |||
1131 | cfhsi->cfdev.use_stx = false; | 1131 | cfhsi->cfdev.use_stx = false; |
1132 | cfhsi->cfdev.use_fcs = false; | 1132 | cfhsi->cfdev.use_fcs = false; |
1133 | cfhsi->ndev = dev; | 1133 | cfhsi->ndev = dev; |
1134 | } | 1134 | cfhsi->cfg = hsi_default_config; |
1135 | |||
1136 | int cfhsi_probe(struct platform_device *pdev) | ||
1137 | { | ||
1138 | struct cfhsi_ops *(*get_ops)(void); | ||
1139 | struct cfhsi *cfhsi = NULL; | ||
1140 | struct net_device *ndev; | ||
1141 | int res; | ||
1142 | |||
1143 | ndev = alloc_netdev(sizeof(struct cfhsi), "cfhsi%d", cfhsi_setup); | ||
1144 | if (!ndev) | ||
1145 | return -ENODEV; | ||
1146 | |||
1147 | cfhsi = netdev_priv(ndev); | ||
1148 | cfhsi->ndev = ndev; | ||
1149 | cfhsi->pdev = pdev; | ||
1150 | |||
1151 | get_ops = symbol_get(cfhsi_get_ops); | ||
1152 | if (!get_ops) { | ||
1153 | pr_err("%s: failed to get the cfhsi_ops\n", __func__); | ||
1154 | return -ENODEV; | ||
1155 | } | ||
1156 | |||
1157 | /* Assign the HSI device. */ | ||
1158 | cfhsi->ops = (*get_ops)(); | ||
1159 | if (!cfhsi->ops) { | ||
1160 | pr_err("%s: failed to get the cfhsi_ops\n", __func__); | ||
1161 | goto err; | ||
1162 | } | ||
1163 | |||
1164 | /* Assign the driver to this HSI device. */ | ||
1165 | cfhsi->ops->cb_ops = &cfhsi->cb_ops; | ||
1166 | res = register_netdevice(ndev); | ||
1167 | if (res) { | ||
1168 | dev_err(&ndev->dev, "%s: Registration error: %d.\n", | ||
1169 | __func__, res); | ||
1170 | free_netdev(ndev); | ||
1171 | } | ||
1172 | /* Add CAIF HSI device to list. */ | ||
1173 | list_add_tail(&cfhsi->list, &cfhsi_list); | ||
1174 | |||
1175 | return res; | ||
1176 | err: | ||
1177 | symbol_put(cfhsi_get_ops); | ||
1178 | return -ENODEV; | ||
1179 | } | 1135 | } |
1180 | 1136 | ||
1181 | static int cfhsi_open(struct net_device *ndev) | 1137 | static int cfhsi_open(struct net_device *ndev) |
@@ -1454,6 +1410,7 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev, | |||
1454 | struct nlattr *tb[], struct nlattr *data[]) | 1410 | struct nlattr *tb[], struct nlattr *data[]) |
1455 | { | 1411 | { |
1456 | struct cfhsi *cfhsi = NULL; | 1412 | struct cfhsi *cfhsi = NULL; |
1413 | struct cfhsi_ops *(*get_ops)(void); | ||
1457 | 1414 | ||
1458 | ASSERT_RTNL(); | 1415 | ASSERT_RTNL(); |
1459 | 1416 | ||
@@ -1461,7 +1418,32 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev, | |||
1461 | cfhsi_netlink_parms(data, cfhsi); | 1418 | cfhsi_netlink_parms(data, cfhsi); |
1462 | dev_net_set(cfhsi->ndev, src_net); | 1419 | dev_net_set(cfhsi->ndev, src_net); |
1463 | 1420 | ||
1421 | get_ops = symbol_get(cfhsi_get_ops); | ||
1422 | if (!get_ops) { | ||
1423 | pr_err("%s: failed to get the cfhsi_ops\n", __func__); | ||
1424 | return -ENODEV; | ||
1425 | } | ||
1426 | |||
1427 | /* Assign the HSI device. */ | ||
1428 | cfhsi->ops = (*get_ops)(); | ||
1429 | if (!cfhsi->ops) { | ||
1430 | pr_err("%s: failed to get the cfhsi_ops\n", __func__); | ||
1431 | goto err; | ||
1432 | } | ||
1433 | |||
1434 | /* Assign the driver to this HSI device. */ | ||
1435 | cfhsi->ops->cb_ops = &cfhsi->cb_ops; | ||
1436 | if (register_netdevice(dev)) { | ||
1437 | pr_warn("%s: caif_hsi device registration failed\n", __func__); | ||
1438 | goto err; | ||
1439 | } | ||
1440 | /* Add CAIF HSI device to list. */ | ||
1441 | list_add_tail(&cfhsi->list, &cfhsi_list); | ||
1442 | |||
1464 | return 0; | 1443 | return 0; |
1444 | err: | ||
1445 | symbol_put(cfhsi_get_ops); | ||
1446 | return -ENODEV; | ||
1465 | } | 1447 | } |
1466 | 1448 | ||
1467 | static struct rtnl_link_ops caif_hsi_link_ops __read_mostly = { | 1449 | static struct rtnl_link_ops caif_hsi_link_ops __read_mostly = { |