From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id A7C1EDDF1A for ; Fri, 20 Jul 2007 17:33:50 +1000 (EST) In-Reply-To: References: <00a85f152aa3547f0f0b4acd7954468a@kernel.crashing.org> <2055bb54b9816faaf5b2ceedc9cfa039@kernel.crashing.org> <87DC7695-382B-4641-B9D9-75ACB49D41A4@kernel.crashing.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <719AE7E4-FE6D-4973-8887-F787EC8ABC85@kernel.crashing.org> From: Segher Boessenkool Subject: Re: [PATCH] powerpc: Add of_register_i2c_devices() Date: Fri, 20 Jul 2007 09:26:58 +0200 To: Guennadi Liakhovetski Cc: linuxppc-dev@ozlabs.org, Paul Mackerras List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , >> 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