aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/caif
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-28 20:37:00 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-28 20:37:00 -0400
commitb26d344c6b87058ae3e8f919a18580abfc4204eb (patch)
treeff7026df8e8715e3c63d0ff4ff697a9fac6323fb /drivers/net/caif
parent82aee5d7c01fd1a398e938e496e6cb8841775f91 (diff)
parent76fbc247b9aebc30f6d2c8ec1f69edcb68eaa328 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/caif/caif_hsi.c drivers/net/usb/qmi_wwan.c The qmi_wwan merge was trivial. The caif_hsi.c, on the other hand, was not. It's a conflict between 1c385f1fdf6f9c66d982802cd74349c040980b50 ("caif-hsi: Replace platform device with ops structure.") in the net-next tree and commit 39abbaef19cd0a30be93794aa4773c779c3eb1f3 ("caif-hsi: Postpone init of HIS until open()") in the net tree. I did my best with that one and will ask Sjur to check it out. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/caif')
-rw-r--r--drivers/net/caif/caif_hsi.c76
1 files changed, 47 insertions, 29 deletions
diff --git a/drivers/net/caif/caif_hsi.c b/drivers/net/caif/caif_hsi.c
index 1c2bd01e1592..087eb83454c0 100644
--- a/drivers/net/caif/caif_hsi.c
+++ b/drivers/net/caif/caif_hsi.c
@@ -678,8 +678,6 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
678 */ 678 */
679 memcpy(rx_buf, (u8 *)piggy_desc, 679 memcpy(rx_buf, (u8 *)piggy_desc,
680 CFHSI_DESC_SHORT_SZ); 680 CFHSI_DESC_SHORT_SZ);
681 /* Mark no embedded frame here */
682 piggy_desc->offset = 0;
683 } 681 }
684 } 682 }
685 683
@@ -720,6 +718,8 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
720 /* Extract any payload in piggyback descriptor. */ 718 /* Extract any payload in piggyback descriptor. */
721 if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0) 719 if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0)
722 goto out_of_sync; 720 goto out_of_sync;
721 /* Mark no embedded frame after extracting it */
722 piggy_desc->offset = 0;
723 } 723 }
724 } 724 }
725 725
@@ -1131,7 +1131,51 @@ 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 cfhsi->cfg = hsi_default_config; 1134}
1135
1136int 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;
1176err:
1177 symbol_put(cfhsi_get_ops);
1178 return -ENODEV;
1135} 1179}
1136 1180
1137static int cfhsi_open(struct net_device *ndev) 1181static int cfhsi_open(struct net_device *ndev)
@@ -1410,7 +1454,6 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev,
1410 struct nlattr *tb[], struct nlattr *data[]) 1454 struct nlattr *tb[], struct nlattr *data[])
1411{ 1455{
1412 struct cfhsi *cfhsi = NULL; 1456 struct cfhsi *cfhsi = NULL;
1413 struct cfhsi_ops *(*get_ops)(void);
1414 1457
1415 ASSERT_RTNL(); 1458 ASSERT_RTNL();
1416 1459
@@ -1418,32 +1461,7 @@ static int caif_hsi_newlink(struct net *src_net, struct net_device *dev,
1418 cfhsi_netlink_parms(data, cfhsi); 1461 cfhsi_netlink_parms(data, cfhsi);
1419 dev_net_set(cfhsi->ndev, src_net); 1462 dev_net_set(cfhsi->ndev, src_net);
1420 1463
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
1443 return 0; 1464 return 0;
1444err:
1445 symbol_put(cfhsi_get_ops);
1446 return -ENODEV;
1447} 1465}
1448 1466
1449static struct rtnl_link_ops caif_hsi_link_ops __read_mostly = { 1467static struct rtnl_link_ops caif_hsi_link_ops __read_mostly = {