]> git.sur5r.net Git - u-boot/commitdiff
Fix warnings introduced by I2C bus speed setting patch
authorKumar Gala <galak@kernel.crashing.org>
Wed, 26 Mar 2008 23:53:28 +0000 (18:53 -0500)
committerWolfgang Denk <wd@denx.de>
Sun, 13 Apr 2008 21:54:16 +0000 (14:54 -0700)
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/i2c/fsl_i2c.c

index dde057124e9bfb7b18cf24c79011a1a11b521d4c..9f2c1eced4de4aea2832aa88da5a27578c97a77f 100644 (file)
@@ -117,7 +117,6 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
 {
        unsigned short divider = min(i2c_clk / speed, (unsigned short) -1);
        unsigned int i;
-       u8 fdr, dfsr;
 
        /*
         * We want to choose an FDR/DFSR that generates an I2C bus speed that
@@ -128,15 +127,15 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
 
        for (i = 0; i < ARRAY_SIZE(fsl_i2c_speed_map); i++)
                if (fsl_i2c_speed_map[i].divider >= divider) {
+                       u8 fdr, dfsr;
                        dfsr = fsl_i2c_speed_map[i].dfsr;
                        fdr = fsl_i2c_speed_map[i].fdr;
                        speed = i2c_clk / fsl_i2c_speed_map[i].divider;
+                       writeb(fdr, &dev->fdr);         /* set bus speed */
+                       writeb(dfsr, &dev->dfsrr);      /* set default filter */
                        break;
                }
 
-       writeb(fdr, &dev->fdr);                 /* set bus speed */
-       writeb(dfsr, &dev->dfsrr);              /* set default filter */
-
        return speed;
 }