[PATCH] i2c: i2c-ibm_iic message can be confusing

Jean Delvare khali at linux-fr.org
Tue Feb 3 04:29:09 EST 2009


On Mon, 2 Feb 2009 12:01:59 -0500, Sean MacLennan wrote:
> This is a trivial patch that does not need to be in 2.6.29. While
> tracking down an EEPROM problem, I found the messages confusing... it
> looked like the EEPROM was being started before the I2C driver!
> 
> Here is an example:
> 
> at24 0-0052: 512 byte 24c04 EEPROM (writable)
> ibm-iic ef600700.i2c: using standard (100 kHz) mode
> ad7414 0-004a: chip found
> 
> It looks like the at24 starts first, then the i2c driver, then the
> ad7414. By moving the message to after the of scan, we always get the
> driver, then the devices.
> 
> Cheers,
>    Sean
> 
> Print the i2c driver message before scanning for devices so that the
> logs show the driver, then the devices. Currently you can get
> device(s), driver, device(s).
> 
> Signed-off-by: Sean MacLennan <smaclennan at pikatech.com>
> ---
> diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
> index 88f0db7..7fc0729 100644
> --- a/drivers/i2c/busses/i2c-ibm_iic.c
> +++ b/drivers/i2c/busses/i2c-ibm_iic.c
> @@ -756,12 +756,12 @@ static int __devinit iic_probe(struct of_device *ofdev,
>  		goto error_cleanup;
>  	}
>  
> -	/* Now register all the child nodes */
> -	of_register_i2c_devices(adap, np);
> -
>  	dev_info(&ofdev->dev, "using %s mode\n",
>  		 dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
>  
> +	/* Now register all the child nodes */
> +	of_register_i2c_devices(adap, np);
> +
>  	return 0;
>  
>  error_cleanup:

Indeed.

Acked-by: Jean Delvare <khali at linux-fr.org>

-- 
Jean Delvare



More information about the Linuxppc-dev mailing list