Commit 937041e21634ffecc92d05cf693423a2c95b7252
Committed by
Grant Likely
1 parent
771669349e
Exists in
master
and in
7 other branches
spi/mpc52xx-spi: minor cleanups
- drop own, obsolete include-file - drop IRQF_SAMPLE_RANDOM (deprecated feature) - drop 'if' above kfree() - typos, braces & whitespaces Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Luotao Fu <l.fu@pengutronix.de> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Showing 2 changed files with 11 additions and 25 deletions Side-by-side Diff
drivers/spi/mpc52xx_spi.c
... | ... | @@ -18,7 +18,6 @@ |
18 | 18 | #include <linux/interrupt.h> |
19 | 19 | #include <linux/delay.h> |
20 | 20 | #include <linux/spi/spi.h> |
21 | -#include <linux/spi/mpc52xx_spi.h> | |
22 | 21 | #include <linux/of_spi.h> |
23 | 22 | #include <linux/io.h> |
24 | 23 | #include <linux/of_gpio.h> |
... | ... | @@ -54,7 +53,7 @@ |
54 | 53 | /* FSM state return values */ |
55 | 54 | #define FSM_STOP 0 /* Nothing more for the state machine to */ |
56 | 55 | /* do. If something interesting happens */ |
57 | - /* then and IRQ will be received */ | |
56 | + /* then an IRQ will be received */ | |
58 | 57 | #define FSM_POLL 1 /* need to poll for completion, an IRQ is */ |
59 | 58 | /* not expected */ |
60 | 59 | #define FSM_CONTINUE 2 /* Keep iterating the state machine */ |
61 | 60 | |
62 | 61 | |
... | ... | @@ -62,13 +61,12 @@ |
62 | 61 | /* Driver internal data */ |
63 | 62 | struct mpc52xx_spi { |
64 | 63 | struct spi_master *master; |
65 | - u32 sysclk; | |
66 | 64 | void __iomem *regs; |
67 | 65 | int irq0; /* MODF irq */ |
68 | 66 | int irq1; /* SPIF irq */ |
69 | - int ipb_freq; | |
67 | + unsigned int ipb_freq; | |
70 | 68 | |
71 | - /* Statistics */ | |
69 | + /* Statistics; not used now, but will be reintroduced for debugfs */ | |
72 | 70 | int msg_count; |
73 | 71 | int wcol_count; |
74 | 72 | int wcol_ticks; |
... | ... | @@ -229,7 +227,7 @@ |
229 | 227 | ms->wcol_tx_timestamp = get_tbl(); |
230 | 228 | data = 0; |
231 | 229 | if (ms->tx_buf) |
232 | - data = *(ms->tx_buf-1); | |
230 | + data = *(ms->tx_buf - 1); | |
233 | 231 | out_8(ms->regs + SPI_DATA, data); /* try again */ |
234 | 232 | return FSM_CONTINUE; |
235 | 233 | } else if (status & SPI_STATUS_MODF) { |
236 | 234 | |
... | ... | @@ -481,8 +479,9 @@ |
481 | 479 | gpio_direction_output(gpio_cs, 1); |
482 | 480 | ms->gpio_cs[i] = gpio_cs; |
483 | 481 | } |
484 | - } else | |
482 | + } else { | |
485 | 483 | master->num_chipselect = 1; |
484 | + } | |
486 | 485 | |
487 | 486 | spin_lock_init(&ms->lock); |
488 | 487 | INIT_LIST_HEAD(&ms->queue); |
489 | 488 | |
... | ... | @@ -490,10 +489,10 @@ |
490 | 489 | |
491 | 490 | /* Decide if interrupts can be used */ |
492 | 491 | if (ms->irq0 && ms->irq1) { |
493 | - rc = request_irq(ms->irq0, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM, | |
492 | + rc = request_irq(ms->irq0, mpc52xx_spi_irq, 0, | |
494 | 493 | "mpc5200-spi-modf", ms); |
495 | - rc |= request_irq(ms->irq1, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM, | |
496 | - "mpc5200-spi-spiF", ms); | |
494 | + rc |= request_irq(ms->irq1, mpc52xx_spi_irq, 0, | |
495 | + "mpc5200-spi-spif", ms); | |
497 | 496 | if (rc) { |
498 | 497 | free_irq(ms->irq0, ms); |
499 | 498 | free_irq(ms->irq1, ms); |
... | ... | @@ -524,8 +523,7 @@ |
524 | 523 | while (i-- > 0) |
525 | 524 | gpio_free(ms->gpio_cs[i]); |
526 | 525 | |
527 | - if (ms->gpio_cs != NULL) | |
528 | - kfree(ms->gpio_cs); | |
526 | + kfree(ms->gpio_cs); | |
529 | 527 | err_alloc: |
530 | 528 | err_init: |
531 | 529 | iounmap(regs); |
... | ... | @@ -544,9 +542,7 @@ |
544 | 542 | for (i = 0; i < ms->gpio_cs_count; i++) |
545 | 543 | gpio_free(ms->gpio_cs[i]); |
546 | 544 | |
547 | - if (ms->gpio_cs != NULL) | |
548 | - kfree(ms->gpio_cs); | |
549 | - | |
545 | + kfree(ms->gpio_cs); | |
550 | 546 | spi_unregister_master(master); |
551 | 547 | spi_master_put(master); |
552 | 548 | iounmap(ms->regs); |