diff options
Diffstat (limited to 'drivers/net/can/mcp251x.c')
-rw-r--r-- | drivers/net/can/mcp251x.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c index b39b108318b4..b11a0cb5ed81 100644 --- a/drivers/net/can/mcp251x.c +++ b/drivers/net/can/mcp251x.c | |||
@@ -58,7 +58,6 @@ | |||
58 | * | 58 | * |
59 | */ | 59 | */ |
60 | 60 | ||
61 | #include <linux/can.h> | ||
62 | #include <linux/can/core.h> | 61 | #include <linux/can/core.h> |
63 | #include <linux/can/dev.h> | 62 | #include <linux/can/dev.h> |
64 | #include <linux/can/platform/mcp251x.h> | 63 | #include <linux/can/platform/mcp251x.h> |
@@ -476,7 +475,6 @@ static netdev_tx_t mcp251x_hard_start_xmit(struct sk_buff *skb, | |||
476 | 475 | ||
477 | netif_stop_queue(net); | 476 | netif_stop_queue(net); |
478 | priv->tx_skb = skb; | 477 | priv->tx_skb = skb; |
479 | net->trans_start = jiffies; | ||
480 | queue_work(priv->wq, &priv->tx_work); | 478 | queue_work(priv->wq, &priv->tx_work); |
481 | 479 | ||
482 | return NETDEV_TX_OK; | 480 | return NETDEV_TX_OK; |
@@ -923,12 +921,16 @@ static int __devinit mcp251x_can_probe(struct spi_device *spi) | |||
923 | struct net_device *net; | 921 | struct net_device *net; |
924 | struct mcp251x_priv *priv; | 922 | struct mcp251x_priv *priv; |
925 | struct mcp251x_platform_data *pdata = spi->dev.platform_data; | 923 | struct mcp251x_platform_data *pdata = spi->dev.platform_data; |
924 | int model = spi_get_device_id(spi)->driver_data; | ||
926 | int ret = -ENODEV; | 925 | int ret = -ENODEV; |
927 | 926 | ||
928 | if (!pdata) | 927 | if (!pdata) |
929 | /* Platform data is required for osc freq */ | 928 | /* Platform data is required for osc freq */ |
930 | goto error_out; | 929 | goto error_out; |
931 | 930 | ||
931 | if (model) | ||
932 | pdata->model = model; | ||
933 | |||
932 | /* Allocate can/net device */ | 934 | /* Allocate can/net device */ |
933 | net = alloc_candev(sizeof(struct mcp251x_priv), TX_ECHO_SKB_MAX); | 935 | net = alloc_candev(sizeof(struct mcp251x_priv), TX_ECHO_SKB_MAX); |
934 | if (!net) { | 936 | if (!net) { |
@@ -1118,6 +1120,15 @@ static int mcp251x_can_resume(struct spi_device *spi) | |||
1118 | #define mcp251x_can_resume NULL | 1120 | #define mcp251x_can_resume NULL |
1119 | #endif | 1121 | #endif |
1120 | 1122 | ||
1123 | static struct spi_device_id mcp251x_id_table[] = { | ||
1124 | { "mcp251x", 0 /* Use pdata.model */ }, | ||
1125 | { "mcp2510", CAN_MCP251X_MCP2510 }, | ||
1126 | { "mcp2515", CAN_MCP251X_MCP2515 }, | ||
1127 | { }, | ||
1128 | }; | ||
1129 | |||
1130 | MODULE_DEVICE_TABLE(spi, mcp251x_id_table); | ||
1131 | |||
1121 | static struct spi_driver mcp251x_can_driver = { | 1132 | static struct spi_driver mcp251x_can_driver = { |
1122 | .driver = { | 1133 | .driver = { |
1123 | .name = DEVICE_NAME, | 1134 | .name = DEVICE_NAME, |
@@ -1125,6 +1136,7 @@ static struct spi_driver mcp251x_can_driver = { | |||
1125 | .owner = THIS_MODULE, | 1136 | .owner = THIS_MODULE, |
1126 | }, | 1137 | }, |
1127 | 1138 | ||
1139 | .id_table = mcp251x_id_table, | ||
1128 | .probe = mcp251x_can_probe, | 1140 | .probe = mcp251x_can_probe, |
1129 | .remove = __devexit_p(mcp251x_can_remove), | 1141 | .remove = __devexit_p(mcp251x_can_remove), |
1130 | .suspend = mcp251x_can_suspend, | 1142 | .suspend = mcp251x_can_suspend, |