Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176175
b: refs/heads/master
c: 937041e
h: refs/heads/master
i:
  176173: 330eac6
  176171: 95635be
  176167: 5996ec7
  176159: 102a020
v: v3
  • Loading branch information
Wolfram Sang authored and Grant Likely committed Dec 9, 2009
1 parent d03b61c commit d642916
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 771669349e6cec0e29a18dc0b5a108e81b85d58c
refs/heads/master: 937041e21634ffecc92d05cf693423a2c95b7252
26 changes: 11 additions & 15 deletions trunk/drivers/spi/mpc52xx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/spi/spi.h>
#include <linux/spi/mpc52xx_spi.h>
#include <linux/of_spi.h>
#include <linux/io.h>
#include <linux/of_gpio.h>
Expand Down Expand Up @@ -54,21 +53,20 @@ MODULE_LICENSE("GPL");
/* FSM state return values */
#define FSM_STOP 0 /* Nothing more for the state machine to */
/* do. If something interesting happens */
/* then and IRQ will be received */
/* then an IRQ will be received */
#define FSM_POLL 1 /* need to poll for completion, an IRQ is */
/* not expected */
#define FSM_CONTINUE 2 /* Keep iterating the state machine */

/* Driver internal data */
struct mpc52xx_spi {
struct spi_master *master;
u32 sysclk;
void __iomem *regs;
int irq0; /* MODF irq */
int irq1; /* SPIF irq */
int ipb_freq;
unsigned int ipb_freq;

/* Statistics */
/* Statistics; not used now, but will be reintroduced for debugfs */
int msg_count;
int wcol_count;
int wcol_ticks;
Expand Down Expand Up @@ -229,7 +227,7 @@ static int mpc52xx_spi_fsmstate_transfer(int irq, struct mpc52xx_spi *ms,
ms->wcol_tx_timestamp = get_tbl();
data = 0;
if (ms->tx_buf)
data = *(ms->tx_buf-1);
data = *(ms->tx_buf - 1);
out_8(ms->regs + SPI_DATA, data); /* try again */
return FSM_CONTINUE;
} else if (status & SPI_STATUS_MODF) {
Expand Down Expand Up @@ -481,19 +479,20 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
gpio_direction_output(gpio_cs, 1);
ms->gpio_cs[i] = gpio_cs;
}
} else
} else {
master->num_chipselect = 1;
}

spin_lock_init(&ms->lock);
INIT_LIST_HEAD(&ms->queue);
INIT_WORK(&ms->work, mpc52xx_spi_wq);

/* Decide if interrupts can be used */
if (ms->irq0 && ms->irq1) {
rc = request_irq(ms->irq0, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM,
rc = request_irq(ms->irq0, mpc52xx_spi_irq, 0,
"mpc5200-spi-modf", ms);
rc |= request_irq(ms->irq1, mpc52xx_spi_irq, IRQF_SAMPLE_RANDOM,
"mpc5200-spi-spiF", ms);
rc |= request_irq(ms->irq1, mpc52xx_spi_irq, 0,
"mpc5200-spi-spif", ms);
if (rc) {
free_irq(ms->irq0, ms);
free_irq(ms->irq1, ms);
Expand Down Expand Up @@ -524,8 +523,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op,
while (i-- > 0)
gpio_free(ms->gpio_cs[i]);

if (ms->gpio_cs != NULL)
kfree(ms->gpio_cs);
kfree(ms->gpio_cs);
err_alloc:
err_init:
iounmap(regs);
Expand All @@ -544,9 +542,7 @@ static int __devexit mpc52xx_spi_remove(struct of_device *op)
for (i = 0; i < ms->gpio_cs_count; i++)
gpio_free(ms->gpio_cs[i]);

if (ms->gpio_cs != NULL)
kfree(ms->gpio_cs);

kfree(ms->gpio_cs);
spi_unregister_master(master);
spi_master_put(master);
iounmap(ms->regs);
Expand Down
10 changes: 0 additions & 10 deletions trunk/include/linux/spi/mpc52xx_spi.h

This file was deleted.

0 comments on commit d642916

Please sign in to comment.