diff options
author | Remi Machet <rmachet@slac.stanford.edu> | 2008-04-21 13:36:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-24 06:57:34 -0400 |
commit | 21dbfd291fe704986fab63a129f89ed2de471329 (patch) | |
tree | c1a498b6e0821573c451a5003c4ce37e06e6e7ec /arch/powerpc | |
parent | 839ad62e75ee1968438d1b72261304cd47fc961e (diff) |
[POWERPC] Use default values if necessary in mv64x60 I2C initialization
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>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/sysdev/mv64x60_dev.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c index 047b31027fa6..c8d9257f431b 100644 --- a/arch/powerpc/sysdev/mv64x60_dev.c +++ b/arch/powerpc/sysdev/mv64x60_dev.c | |||
@@ -338,15 +338,13 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id) | |||
338 | 338 | ||
339 | pdata.freq_m = 8; /* default */ | 339 | pdata.freq_m = 8; /* default */ |
340 | prop = of_get_property(np, "freq_m", NULL); | 340 | prop = of_get_property(np, "freq_m", NULL); |
341 | if (!prop) | 341 | if (prop) |
342 | return -ENODEV; | 342 | pdata.freq_m = *prop; |
343 | pdata.freq_m = *prop; | ||
344 | 343 | ||
345 | pdata.freq_m = 3; /* default */ | 344 | pdata.freq_m = 3; /* default */ |
346 | prop = of_get_property(np, "freq_n", NULL); | 345 | prop = of_get_property(np, "freq_n", NULL); |
347 | if (!prop) | 346 | if (prop) |
348 | return -ENODEV; | 347 | pdata.freq_n = *prop; |
349 | pdata.freq_n = *prop; | ||
350 | 348 | ||
351 | pdata.timeout = 1000; /* default: 1 second */ | 349 | pdata.timeout = 1000; /* default: 1 second */ |
352 | 350 | ||