[PATCH 1/2 v2] sysdev,mv64x60: I2C defaults
Remi Machet
rmachet at slac.stanford.edu
Tue Apr 22 03:36:48 EST 2008
I2C parameters freq_m and freq_n are assigned default in the code
but if those properties are not found in the open firmware description
the init returns an error => the code now uses the default
values if the properties are not found.
Signed-off-by: Remi Machet (rmachet at slac.stanford.edu)
---
This is the first part of the re-submission of my patch of 4/17/2008
titled "[PATCH] sysdev,mv64x60: initialization of mv64x60 ethernet,
serial and I2C"
--- 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)
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 */
More information about the Linuxppc-dev
mailing list