diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-08-06 08:53:57 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-09-21 02:38:22 -0400 |
commit | 0012e5c9315c33fe8d62cb8cb87a95484d7761c1 (patch) | |
tree | 42dd711055155f803f12cea796ad374f9a527270 /drivers/net/can | |
parent | a1ef48e1e8843e2f6be631b8cf1c21b24579b9d6 (diff) |
can: flexcan: cleanup coding style and fix typos
This patch fixes up the coding style to make checkpatch happier. Some typos are
also fixed.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/flexcan.c | 90 |
1 files changed, 38 insertions, 52 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index c83f0f03482b..e9e8f095461c 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -63,10 +63,10 @@ | |||
63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) | 63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) |
64 | #define FLEXCAN_MCR_AEN BIT(12) | 64 | #define FLEXCAN_MCR_AEN BIT(12) |
65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0x7f) | 65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0x7f) |
66 | #define FLEXCAN_MCR_IDAM_A (0 << 8) | 66 | #define FLEXCAN_MCR_IDAM_A (0x0 << 8) |
67 | #define FLEXCAN_MCR_IDAM_B (1 << 8) | 67 | #define FLEXCAN_MCR_IDAM_B (0x1 << 8) |
68 | #define FLEXCAN_MCR_IDAM_C (2 << 8) | 68 | #define FLEXCAN_MCR_IDAM_C (0x2 << 8) |
69 | #define FLEXCAN_MCR_IDAM_D (3 << 8) | 69 | #define FLEXCAN_MCR_IDAM_D (0x3 << 8) |
70 | 70 | ||
71 | /* FLEXCAN control register (CANCTRL) bits */ | 71 | /* FLEXCAN control register (CANCTRL) bits */ |
72 | #define FLEXCAN_CTRL_PRESDIV(x) (((x) & 0xff) << 24) | 72 | #define FLEXCAN_CTRL_PRESDIV(x) (((x) & 0xff) << 24) |
@@ -161,7 +161,7 @@ | |||
161 | #define FLEXCAN_MB_CODE_RX_INACTIVE (0x0 << 24) | 161 | #define FLEXCAN_MB_CODE_RX_INACTIVE (0x0 << 24) |
162 | #define FLEXCAN_MB_CODE_RX_EMPTY (0x4 << 24) | 162 | #define FLEXCAN_MB_CODE_RX_EMPTY (0x4 << 24) |
163 | #define FLEXCAN_MB_CODE_RX_FULL (0x2 << 24) | 163 | #define FLEXCAN_MB_CODE_RX_FULL (0x2 << 24) |
164 | #define FLEXCAN_MB_CODE_RX_OVERRRUN (0x6 << 24) | 164 | #define FLEXCAN_MB_CODE_RX_OVERRUN (0x6 << 24) |
165 | #define FLEXCAN_MB_CODE_RX_RANSWER (0xa << 24) | 165 | #define FLEXCAN_MB_CODE_RX_RANSWER (0xa << 24) |
166 | 166 | ||
167 | #define FLEXCAN_MB_CODE_TX_INACTIVE (0x8 << 24) | 167 | #define FLEXCAN_MB_CODE_TX_INACTIVE (0x8 << 24) |
@@ -175,12 +175,9 @@ | |||
175 | #define FLEXCAN_MB_CNT_LENGTH(x) (((x) & 0xf) << 16) | 175 | #define FLEXCAN_MB_CNT_LENGTH(x) (((x) & 0xf) << 16) |
176 | #define FLEXCAN_MB_CNT_TIMESTAMP(x) ((x) & 0xffff) | 176 | #define FLEXCAN_MB_CNT_TIMESTAMP(x) ((x) & 0xffff) |
177 | 177 | ||
178 | #define FLEXCAN_MB_CODE_MASK (0xf0ffffff) | 178 | #define FLEXCAN_TIMEOUT_US (50) |
179 | 179 | ||
180 | #define FLEXCAN_TIMEOUT_US (50) | 180 | /* FLEXCAN hardware feature flags |
181 | |||
182 | /* | ||
183 | * FLEXCAN hardware feature flags | ||
184 | * | 181 | * |
185 | * Below is some version info we got: | 182 | * Below is some version info we got: |
186 | * SOC Version IP-Version Glitch- [TR]WRN_INT Memory err RTR re- | 183 | * SOC Version IP-Version Glitch- [TR]WRN_INT Memory err RTR re- |
@@ -236,7 +233,7 @@ struct flexcan_regs { | |||
236 | * 0x0e0...0x0ff 6-7 8 entry ID table | 233 | * 0x0e0...0x0ff 6-7 8 entry ID table |
237 | * (mx25, mx28, mx35, mx53) | 234 | * (mx25, mx28, mx35, mx53) |
238 | * 0x0e0...0x2df 6-7..37 8..128 entry ID table | 235 | * 0x0e0...0x2df 6-7..37 8..128 entry ID table |
239 | * size conf'ed via ctrl2::RFFN | 236 | * size conf'ed via ctrl2::RFFN |
240 | * (mx6, vf610) | 237 | * (mx6, vf610) |
241 | */ | 238 | */ |
242 | u32 _reserved4[408]; | 239 | u32 _reserved4[408]; |
@@ -272,10 +269,13 @@ struct flexcan_priv { | |||
272 | static struct flexcan_devtype_data fsl_p1010_devtype_data = { | 269 | static struct flexcan_devtype_data fsl_p1010_devtype_data = { |
273 | .features = FLEXCAN_HAS_BROKEN_ERR_STATE, | 270 | .features = FLEXCAN_HAS_BROKEN_ERR_STATE, |
274 | }; | 271 | }; |
272 | |||
275 | static struct flexcan_devtype_data fsl_imx28_devtype_data; | 273 | static struct flexcan_devtype_data fsl_imx28_devtype_data; |
274 | |||
276 | static struct flexcan_devtype_data fsl_imx6q_devtype_data = { | 275 | static struct flexcan_devtype_data fsl_imx6q_devtype_data = { |
277 | .features = FLEXCAN_HAS_V10_FEATURES, | 276 | .features = FLEXCAN_HAS_V10_FEATURES, |
278 | }; | 277 | }; |
278 | |||
279 | static struct flexcan_devtype_data fsl_vf610_devtype_data = { | 279 | static struct flexcan_devtype_data fsl_vf610_devtype_data = { |
280 | .features = FLEXCAN_HAS_V10_FEATURES | FLEXCAN_HAS_MECR_FEATURES, | 280 | .features = FLEXCAN_HAS_V10_FEATURES | FLEXCAN_HAS_MECR_FEATURES, |
281 | }; | 281 | }; |
@@ -292,11 +292,10 @@ static const struct can_bittiming_const flexcan_bittiming_const = { | |||
292 | .brp_inc = 1, | 292 | .brp_inc = 1, |
293 | }; | 293 | }; |
294 | 294 | ||
295 | /* | 295 | /* Abstract off the read/write for arm versus ppc. This |
296 | * Abstract off the read/write for arm versus ppc. This | ||
297 | * assumes that PPC uses big-endian registers and everything | 296 | * assumes that PPC uses big-endian registers and everything |
298 | * else uses little-endian registers, independent of CPU | 297 | * else uses little-endian registers, independent of CPU |
299 | * endianess. | 298 | * endianness. |
300 | */ | 299 | */ |
301 | #if defined(CONFIG_PPC) | 300 | #if defined(CONFIG_PPC) |
302 | static inline u32 flexcan_read(void __iomem *addr) | 301 | static inline u32 flexcan_read(void __iomem *addr) |
@@ -434,7 +433,6 @@ static int flexcan_chip_softreset(struct flexcan_priv *priv) | |||
434 | return 0; | 433 | return 0; |
435 | } | 434 | } |
436 | 435 | ||
437 | |||
438 | static int __flexcan_get_berr_counter(const struct net_device *dev, | 436 | static int __flexcan_get_berr_counter(const struct net_device *dev, |
439 | struct can_berr_counter *bec) | 437 | struct can_berr_counter *bec) |
440 | { | 438 | { |
@@ -477,6 +475,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
477 | struct flexcan_regs __iomem *regs = priv->base; | 475 | struct flexcan_regs __iomem *regs = priv->base; |
478 | struct can_frame *cf = (struct can_frame *)skb->data; | 476 | struct can_frame *cf = (struct can_frame *)skb->data; |
479 | u32 can_id; | 477 | u32 can_id; |
478 | u32 data; | ||
480 | u32 ctrl = FLEXCAN_MB_CODE_TX_DATA | (cf->can_dlc << 16); | 479 | u32 ctrl = FLEXCAN_MB_CODE_TX_DATA | (cf->can_dlc << 16); |
481 | 480 | ||
482 | if (can_dropped_invalid_skb(dev, skb)) | 481 | if (can_dropped_invalid_skb(dev, skb)) |
@@ -495,11 +494,11 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
495 | ctrl |= FLEXCAN_MB_CNT_RTR; | 494 | ctrl |= FLEXCAN_MB_CNT_RTR; |
496 | 495 | ||
497 | if (cf->can_dlc > 0) { | 496 | if (cf->can_dlc > 0) { |
498 | u32 data = be32_to_cpup((__be32 *)&cf->data[0]); | 497 | data = be32_to_cpup((__be32 *)&cf->data[0]); |
499 | flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]); | 498 | flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]); |
500 | } | 499 | } |
501 | if (cf->can_dlc > 3) { | 500 | if (cf->can_dlc > 3) { |
502 | u32 data = be32_to_cpup((__be32 *)&cf->data[4]); | 501 | data = be32_to_cpup((__be32 *)&cf->data[4]); |
503 | flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]); | 502 | flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]); |
504 | } | 503 | } |
505 | 504 | ||
@@ -597,14 +596,14 @@ static int flexcan_poll_state(struct net_device *dev, u32 reg_esr) | |||
597 | flt = reg_esr & FLEXCAN_ESR_FLT_CONF_MASK; | 596 | flt = reg_esr & FLEXCAN_ESR_FLT_CONF_MASK; |
598 | if (likely(flt == FLEXCAN_ESR_FLT_CONF_ACTIVE)) { | 597 | if (likely(flt == FLEXCAN_ESR_FLT_CONF_ACTIVE)) { |
599 | tx_state = unlikely(reg_esr & FLEXCAN_ESR_TX_WRN) ? | 598 | tx_state = unlikely(reg_esr & FLEXCAN_ESR_TX_WRN) ? |
600 | CAN_STATE_ERROR_WARNING : CAN_STATE_ERROR_ACTIVE; | 599 | CAN_STATE_ERROR_WARNING : CAN_STATE_ERROR_ACTIVE; |
601 | rx_state = unlikely(reg_esr & FLEXCAN_ESR_RX_WRN) ? | 600 | rx_state = unlikely(reg_esr & FLEXCAN_ESR_RX_WRN) ? |
602 | CAN_STATE_ERROR_WARNING : CAN_STATE_ERROR_ACTIVE; | 601 | CAN_STATE_ERROR_WARNING : CAN_STATE_ERROR_ACTIVE; |
603 | new_state = max(tx_state, rx_state); | 602 | new_state = max(tx_state, rx_state); |
604 | } else { | 603 | } else { |
605 | __flexcan_get_berr_counter(dev, &bec); | 604 | __flexcan_get_berr_counter(dev, &bec); |
606 | new_state = flt == FLEXCAN_ESR_FLT_CONF_PASSIVE ? | 605 | new_state = flt == FLEXCAN_ESR_FLT_CONF_PASSIVE ? |
607 | CAN_STATE_ERROR_PASSIVE : CAN_STATE_BUS_OFF; | 606 | CAN_STATE_ERROR_PASSIVE : CAN_STATE_BUS_OFF; |
608 | rx_state = bec.rxerr >= bec.txerr ? new_state : 0; | 607 | rx_state = bec.rxerr >= bec.txerr ? new_state : 0; |
609 | tx_state = bec.rxerr <= bec.txerr ? new_state : 0; | 608 | tx_state = bec.rxerr <= bec.txerr ? new_state : 0; |
610 | } | 609 | } |
@@ -687,8 +686,7 @@ static int flexcan_poll(struct napi_struct *napi, int quota) | |||
687 | u32 reg_iflag1, reg_esr; | 686 | u32 reg_iflag1, reg_esr; |
688 | int work_done = 0; | 687 | int work_done = 0; |
689 | 688 | ||
690 | /* | 689 | /* The error bits are cleared on read, |
691 | * The error bits are cleared on read, | ||
692 | * use saved value from irq handler. | 690 | * use saved value from irq handler. |
693 | */ | 691 | */ |
694 | reg_esr = flexcan_read(®s->esr) | priv->reg_esr; | 692 | reg_esr = flexcan_read(®s->esr) | priv->reg_esr; |
@@ -728,12 +726,12 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) | |||
728 | 726 | ||
729 | reg_iflag1 = flexcan_read(®s->iflag1); | 727 | reg_iflag1 = flexcan_read(®s->iflag1); |
730 | reg_esr = flexcan_read(®s->esr); | 728 | reg_esr = flexcan_read(®s->esr); |
729 | |||
731 | /* ACK all bus error and state change IRQ sources */ | 730 | /* ACK all bus error and state change IRQ sources */ |
732 | if (reg_esr & FLEXCAN_ESR_ALL_INT) | 731 | if (reg_esr & FLEXCAN_ESR_ALL_INT) |
733 | flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, ®s->esr); | 732 | flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, ®s->esr); |
734 | 733 | ||
735 | /* | 734 | /* schedule NAPI in case of: |
736 | * schedule NAPI in case of: | ||
737 | * - rx IRQ | 735 | * - rx IRQ |
738 | * - state change IRQ | 736 | * - state change IRQ |
739 | * - bus error IRQ and bus error reporting is activated | 737 | * - bus error IRQ and bus error reporting is activated |
@@ -741,15 +739,14 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) | |||
741 | if ((reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE) || | 739 | if ((reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE) || |
742 | (reg_esr & FLEXCAN_ESR_ERR_STATE) || | 740 | (reg_esr & FLEXCAN_ESR_ERR_STATE) || |
743 | flexcan_has_and_handle_berr(priv, reg_esr)) { | 741 | flexcan_has_and_handle_berr(priv, reg_esr)) { |
744 | /* | 742 | /* The error bits are cleared on read, |
745 | * The error bits are cleared on read, | ||
746 | * save them for later use. | 743 | * save them for later use. |
747 | */ | 744 | */ |
748 | priv->reg_esr = reg_esr & FLEXCAN_ESR_ERR_BUS; | 745 | priv->reg_esr = reg_esr & FLEXCAN_ESR_ERR_BUS; |
749 | flexcan_write(FLEXCAN_IFLAG_DEFAULT & | 746 | flexcan_write(FLEXCAN_IFLAG_DEFAULT & |
750 | ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->imask1); | 747 | ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->imask1); |
751 | flexcan_write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL, | 748 | flexcan_write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL, |
752 | ®s->ctrl); | 749 | ®s->ctrl); |
753 | napi_schedule(&priv->napi); | 750 | napi_schedule(&priv->napi); |
754 | } | 751 | } |
755 | 752 | ||
@@ -765,7 +762,8 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id) | |||
765 | stats->tx_bytes += can_get_echo_skb(dev, 0); | 762 | stats->tx_bytes += can_get_echo_skb(dev, 0); |
766 | stats->tx_packets++; | 763 | stats->tx_packets++; |
767 | can_led_event(dev, CAN_LED_EVENT_TX); | 764 | can_led_event(dev, CAN_LED_EVENT_TX); |
768 | /* after sending a RTR frame mailbox is in RX mode */ | 765 | |
766 | /* after sending a RTR frame MB is in RX mode */ | ||
769 | flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE, | 767 | flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE, |
770 | ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); | 768 | ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); |
771 | flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1); | 769 | flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1); |
@@ -813,8 +811,7 @@ static void flexcan_set_bittiming(struct net_device *dev) | |||
813 | flexcan_read(®s->mcr), flexcan_read(®s->ctrl)); | 811 | flexcan_read(®s->mcr), flexcan_read(®s->ctrl)); |
814 | } | 812 | } |
815 | 813 | ||
816 | /* | 814 | /* flexcan_chip_start |
817 | * flexcan_chip_start | ||
818 | * | 815 | * |
819 | * this functions is entered with clocks enabled | 816 | * this functions is entered with clocks enabled |
820 | * | 817 | * |
@@ -838,8 +835,7 @@ static int flexcan_chip_start(struct net_device *dev) | |||
838 | 835 | ||
839 | flexcan_set_bittiming(dev); | 836 | flexcan_set_bittiming(dev); |
840 | 837 | ||
841 | /* | 838 | /* MCR |
842 | * MCR | ||
843 | * | 839 | * |
844 | * enable freeze | 840 | * enable freeze |
845 | * enable fifo | 841 | * enable fifo |
@@ -848,7 +844,6 @@ static int flexcan_chip_start(struct net_device *dev) | |||
848 | * enable warning int | 844 | * enable warning int |
849 | * choose format C | 845 | * choose format C |
850 | * disable local echo | 846 | * disable local echo |
851 | * | ||
852 | */ | 847 | */ |
853 | reg_mcr = flexcan_read(®s->mcr); | 848 | reg_mcr = flexcan_read(®s->mcr); |
854 | reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); | 849 | reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); |
@@ -859,8 +854,7 @@ static int flexcan_chip_start(struct net_device *dev) | |||
859 | netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); | 854 | netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); |
860 | flexcan_write(reg_mcr, ®s->mcr); | 855 | flexcan_write(reg_mcr, ®s->mcr); |
861 | 856 | ||
862 | /* | 857 | /* CTRL |
863 | * CTRL | ||
864 | * | 858 | * |
865 | * disable timer sync feature | 859 | * disable timer sync feature |
866 | * | 860 | * |
@@ -875,8 +869,8 @@ static int flexcan_chip_start(struct net_device *dev) | |||
875 | reg_ctrl &= ~FLEXCAN_CTRL_TSYN; | 869 | reg_ctrl &= ~FLEXCAN_CTRL_TSYN; |
876 | reg_ctrl |= FLEXCAN_CTRL_BOFF_REC | FLEXCAN_CTRL_LBUF | | 870 | reg_ctrl |= FLEXCAN_CTRL_BOFF_REC | FLEXCAN_CTRL_LBUF | |
877 | FLEXCAN_CTRL_ERR_STATE; | 871 | FLEXCAN_CTRL_ERR_STATE; |
878 | /* | 872 | |
879 | * enable the "error interrupt" (FLEXCAN_CTRL_ERR_MSK), | 873 | /* enable the "error interrupt" (FLEXCAN_CTRL_ERR_MSK), |
880 | * on most Flexcan cores, too. Otherwise we don't get | 874 | * on most Flexcan cores, too. Otherwise we don't get |
881 | * any error warning or passive interrupts. | 875 | * any error warning or passive interrupts. |
882 | */ | 876 | */ |
@@ -913,16 +907,14 @@ static int flexcan_chip_start(struct net_device *dev) | |||
913 | if (priv->devtype_data->features & FLEXCAN_HAS_V10_FEATURES) | 907 | if (priv->devtype_data->features & FLEXCAN_HAS_V10_FEATURES) |
914 | flexcan_write(0x0, ®s->rxfgmask); | 908 | flexcan_write(0x0, ®s->rxfgmask); |
915 | 909 | ||
916 | /* | 910 | /* On Vybrid, disable memory error detection interrupts |
917 | * On Vybrid, disable memory error detection interrupts | ||
918 | * and freeze mode. | 911 | * and freeze mode. |
919 | * This also works around errata e5295 which generates | 912 | * This also works around errata e5295 which generates |
920 | * false positive memory errors and put the device in | 913 | * false positive memory errors and put the device in |
921 | * freeze mode. | 914 | * freeze mode. |
922 | */ | 915 | */ |
923 | if (priv->devtype_data->features & FLEXCAN_HAS_MECR_FEATURES) { | 916 | if (priv->devtype_data->features & FLEXCAN_HAS_MECR_FEATURES) { |
924 | /* | 917 | /* Follow the protocol as described in "Detection |
925 | * Follow the protocol as described in "Detection | ||
926 | * and Correction of Memory Errors" to write to | 918 | * and Correction of Memory Errors" to write to |
927 | * MECR register | 919 | * MECR register |
928 | */ | 920 | */ |
@@ -934,7 +926,7 @@ static int flexcan_chip_start(struct net_device *dev) | |||
934 | reg_mecr &= ~FLEXCAN_MECR_ECRWRDIS; | 926 | reg_mecr &= ~FLEXCAN_MECR_ECRWRDIS; |
935 | flexcan_write(reg_mecr, ®s->mecr); | 927 | flexcan_write(reg_mecr, ®s->mecr); |
936 | reg_mecr &= ~(FLEXCAN_MECR_NCEFAFRZ | FLEXCAN_MECR_HANCEI_MSK | | 928 | reg_mecr &= ~(FLEXCAN_MECR_NCEFAFRZ | FLEXCAN_MECR_HANCEI_MSK | |
937 | FLEXCAN_MECR_FANCEI_MSK); | 929 | FLEXCAN_MECR_FANCEI_MSK); |
938 | flexcan_write(reg_mecr, ®s->mecr); | 930 | flexcan_write(reg_mecr, ®s->mecr); |
939 | } | 931 | } |
940 | 932 | ||
@@ -965,11 +957,9 @@ static int flexcan_chip_start(struct net_device *dev) | |||
965 | return err; | 957 | return err; |
966 | } | 958 | } |
967 | 959 | ||
968 | /* | 960 | /* flexcan_chip_stop |
969 | * flexcan_chip_stop | ||
970 | * | 961 | * |
971 | * this functions is entered with clocks enabled | 962 | * this functions is entered with clocks enabled |
972 | * | ||
973 | */ | 963 | */ |
974 | static void flexcan_chip_stop(struct net_device *dev) | 964 | static void flexcan_chip_stop(struct net_device *dev) |
975 | { | 965 | { |
@@ -987,8 +977,6 @@ static void flexcan_chip_stop(struct net_device *dev) | |||
987 | 977 | ||
988 | flexcan_transceiver_disable(priv); | 978 | flexcan_transceiver_disable(priv); |
989 | priv->can.state = CAN_STATE_STOPPED; | 979 | priv->can.state = CAN_STATE_STOPPED; |
990 | |||
991 | return; | ||
992 | } | 980 | } |
993 | 981 | ||
994 | static int flexcan_open(struct net_device *dev) | 982 | static int flexcan_open(struct net_device *dev) |
@@ -1114,8 +1102,7 @@ static int register_flexcandev(struct net_device *dev) | |||
1114 | FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV; | 1102 | FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV; |
1115 | flexcan_write(reg, ®s->mcr); | 1103 | flexcan_write(reg, ®s->mcr); |
1116 | 1104 | ||
1117 | /* | 1105 | /* Currently we only support newer versions of this core |
1118 | * Currently we only support newer versions of this core | ||
1119 | * featuring a RX FIFO. Older cores found on some Coldfire | 1106 | * featuring a RX FIFO. Older cores found on some Coldfire |
1120 | * derivates are not yet supported. | 1107 | * derivates are not yet supported. |
1121 | */ | 1108 | */ |
@@ -1180,7 +1167,7 @@ static int flexcan_probe(struct platform_device *pdev) | |||
1180 | 1167 | ||
1181 | if (pdev->dev.of_node) | 1168 | if (pdev->dev.of_node) |
1182 | of_property_read_u32(pdev->dev.of_node, | 1169 | of_property_read_u32(pdev->dev.of_node, |
1183 | "clock-frequency", &clock_freq); | 1170 | "clock-frequency", &clock_freq); |
1184 | 1171 | ||
1185 | if (!clock_freq) { | 1172 | if (!clock_freq) { |
1186 | clk_ipg = devm_clk_get(&pdev->dev, "ipg"); | 1173 | clk_ipg = devm_clk_get(&pdev->dev, "ipg"); |
@@ -1237,7 +1224,6 @@ static int flexcan_probe(struct platform_device *pdev) | |||
1237 | priv->clk_per = clk_per; | 1224 | priv->clk_per = clk_per; |
1238 | priv->pdata = dev_get_platdata(&pdev->dev); | 1225 | priv->pdata = dev_get_platdata(&pdev->dev); |
1239 | priv->devtype_data = devtype_data; | 1226 | priv->devtype_data = devtype_data; |
1240 | |||
1241 | priv->reg_xceiver = reg_xceiver; | 1227 | priv->reg_xceiver = reg_xceiver; |
1242 | 1228 | ||
1243 | netif_napi_add(dev, &priv->napi, flexcan_poll, FLEXCAN_NAPI_WEIGHT); | 1229 | netif_napi_add(dev, &priv->napi, flexcan_poll, FLEXCAN_NAPI_WEIGHT); |