Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2ed355165ff4ec834a75770f2a15dc87f5e06088
Commit:     2ed355165ff4ec834a75770f2a15dc87f5e06088
Parent:     fad91c890909aabab0d9858d50f3c8394ee16b21
Author:     Mike Frysinger <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 4 23:45:14 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Dec 5 09:21:19 2007 -0800

    spi: spi_bfin, don't bypass spi framework
    
    Prevent people from setting bits in ctl_reg that the SPI framework already
    handles, hopefully we can one day drop ctl_reg completely
    
    Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
    Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/spi/spi_bfin5xx.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index c2d51cf..8e4ea89 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -998,6 +998,18 @@ static int setup(struct spi_device *spi)
 
        /* chip_info isn't always needed */
        if (chip_info) {
+               /* Make sure people stop trying to set fields via ctl_reg
+                * when they should actually be using common SPI framework.
+                * Currently we let through: WOM EMISO PSSE GM SZ TIMOD.
+                * Not sure if a user actually needs/uses any of these,
+                * but let's assume (for now) they do.
+                */
+               if (chip_info->ctl_reg & (SPE|MSTR|CPOL|CPHA|LSBF|SIZE)) {
+                       dev_err(&spi->dev, "do not set bits in ctl_reg "
+                               "that the SPI framework manages\n");
+                       return -EINVAL;
+               }
+
                chip->enable_dma = chip_info->enable_dma != 0
                    && drv_data->master_info->enable_dma;
                chip->ctl_reg = chip_info->ctl_reg;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to