[PATCH] powerpc: Add of_register_i2c_devices()

Segher Boessenkool segher at kernel.crashing.org
Fri Jul 20 17:26:58 EST 2007


>> You might want to put vendor names in the "compatible"
>> entries, dunno though, maybe these are "cross-vendor"
>> ICs?
>
> You mean like
>
> 	compatible = "ricoh,rs5c372a"

Yeah, like that.  I'm not sure it is needed for these,
but it won't hurt either.

> +		strncpy(info->driver_name, i2c_devices[i].i2c_driver,  
> KOBJ_NAME_LEN);
> +		strncpy(info->type, i2c_devices[i].i2c_type, I2C_NAME_SIZE);

Why not just strcpy(), btw?

> +		addr = of_get_property(node, "reg", &len);
> +		if (!addr || len < sizeof(int) || *addr > 0xffff)
> +			continue;

Give a warning when the addr won't fit in 16 bits?


Segher




More information about the Linuxppc-dev mailing list