Skip to content

Commit 7fa8ad6

Browse files
Sjur Brændelanddavem330
authored andcommitted
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>
1 parent 3085a4b commit 7fa8ad6

File tree

1 file changed

+27
-45
lines changed

1 file changed

+27
-45
lines changed

drivers/net/caif/caif_hsi.c

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,51 +1131,7 @@ static void cfhsi_setup(struct net_device *dev)
11311131
cfhsi->cfdev.use_stx = false;
11321132
cfhsi->cfdev.use_fcs = false;
11331133
cfhsi->ndev = dev;
1134-
}
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;
1134+
cfhsi->cfg = hsi_default_config;
11791135
}
11801136

11811137
static int cfhsi_open(struct net_device *ndev)
@@ -1454,14 +1410,40 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev,
14541410
struct nlattr *tb[], struct nlattr *data[])
14551411
{
14561412
struct cfhsi *cfhsi = NULL;
1413+
struct cfhsi_ops *(*get_ops)(void);
14571414

14581415
ASSERT_RTNL();
14591416

14601417
cfhsi = netdev_priv(dev);
14611418
cfhsi_netlink_parms(data, cfhsi);
14621419
dev_net_set(cfhsi->ndev, src_net);
14631420

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+
14641443
return 0;
1444+
err:
1445+
symbol_put(cfhsi_get_ops);
1446+
return -ENODEV;
14651447
}
14661448

14671449
static struct rtnl_link_ops caif_hsi_link_ops __read_mostly = {

0 commit comments

Comments
 (0)