]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] Use default values if necessary in mv64x60 I2C initialization
authorRemi Machet <rmachet@slac.stanford.edu>
Mon, 21 Apr 2008 17:36:48 +0000 (03:36 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 24 Apr 2008 10:57:34 +0000 (20:57 +1000)
I2C parameters freq_m and freq_n are assigned defaults in the code,
but if properties for those parameters are not found in the open
firmware description the init routine returns an error and doesn't
create the platform device.

This changes the code so that it doesn't return an error if the
properties are not found but instead uses the default values.

Signed-off-by: Remi Machet (rmachet@slac.stanford.edu)
Acked-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/sysdev/mv64x60_dev.c

index 047b31027fa6500ec03ba55727da52d6b1fc58ad..c8d9257f431b089869bebf951c89289e34acd20a 100644 (file)
@@ -338,15 +338,13 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id)
 
        pdata.freq_m = 8;       /* default */
        prop = of_get_property(np, "freq_m", NULL);
-       if (!prop)
-               return -ENODEV;
-       pdata.freq_m = *prop;
+       if (prop)
+               pdata.freq_m = *prop;
 
        pdata.freq_m = 3;       /* default */
        prop = of_get_property(np, "freq_n", NULL);
-       if (!prop)
-               return -ENODEV;
-       pdata.freq_n = *prop;
+       if (prop)
+               pdata.freq_n = *prop;
 
        pdata.timeout = 1000;                           /* default: 1 second */