Thanks Pei and Greg. I got it to compile without errors and working by moving to the new method.!!!! One issue though is:-
Would it be possible to run a usermode driver to access an i2c device when I am not exercising the kernel mode driver (i.e without rmmode - ing the driver)? (Basically it boils down to can drivers of two nature - i.e kernel mode and user mode , access the same part one after the other without any problem?) On Sun, Dec 13, 2009 at 8:01 PM, Pei Lin <[email protected]> wrote: > 2009/12/10 LKomz Komz <[email protected]>: > > > > Are there any documentation on what the changes in the i2c modules are > going > > from 2.6.22 to 2.6.31. > > The driver which compiles and runs on 2.6.22 returns the following errors > > when compiled on 2.6.31. > > I have included the correspondign lies from the code to clarify my > > predicament. Due to the current urgency I am sticking to the old binding > > method as the new method requires more indepth understanding. Are there > ways > > to get over the following messages? > > > > error: unknown field ‘detach_client’ specified in initializer > > > > device_create(lkmoz_class,NULL,lkomz_dev_number, LKOMZ_DEV_NAME) > > =>error: too few arguments to function ‘device_create’ > > > > kernel 32: > struct device *device_create(struct class *class, struct device *parent, > 1480 dev_t devt, void *drvdata, const char > *fmt, ...) > > kernel 22: > > struct device *device_create(struct class *class, struct device *parent, > 1165 dev_t devt, const char *fmt, ...) > > Error message told us parameter changed. Many thousands people > contribute for the kernel community and the documents always are the > old fashions. The code changes everyday, and i think that's the charm > of the linux kernel. Everyday it's the same but everything is changed. > > > i2c_probe(adapter,&lkomz_addr_data,lkomz_attach) > > =>error: implicit declaration of function ‘i2c_probe’ > > > > i2c_detach_client(client) > > =>error: implicit declaration of function ‘i2c_detach_client’ > > > > make[1]: Leaving directory `/usr/src/kernels/linux-2.6.31' > > make: *** [all] Error 2 > > > > > > Any help would be greatly appreciaetd. > > > > Thanking you. > > > > L Komz. > > > > > > On Fri, Dec 4, 2009 at 10:19 PM, Greg KH <[email protected]> wrote: > >> > >> On Fri, Dec 04, 2009 at 02:29:36PM -0600, LKomz Komz wrote: > >> > Thanks Greg for the reply! > >> > > >> > I have an i2c driver written using the attach method for binding. It > >> > opens > >> > the device and reads the registers etc. > >> > > >> > The following document talks about another binding method. > >> > http://www.kernel.org/doc/Documentation/i2c/upgrading-clients > >> > > >> > Could you clarify that whether the new binding method is the way to go > >> > for > >> > i2c devices. > >> > >> Yes, why would the document lie? > >> > >> > Do I have to rewrite the current driver to make it compatible with > >> > future kernel versions.? > >> > >> Yes. > >> > >> The best thing for you to do is get it into the main kernel tree, then > >> it will remain compatible with future kernel versions as the API changes > >> over time. > >> > >> thanks, > >> > >> greg k-h > > > > > > > > -- > Best Regards > Lin >
