From ea315df1c35d65a2aca533d2e06859aceb196d1d Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Fri, 11 Dec 1998 02:16:59 +0000 Subject: [PATCH] Made the ISA/SMBus code shut up if DEBUG is off and things try to access unimplementable functionality. And removed a #if which could never become true anyway from i2c-proc.c. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@67 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-isa.c | 6 ++++++ kernel/i2c-proc.c | 3 --- kernel/smbus.c | 6 ++++++ src/i2c-proc.c | 3 --- src/isa.c | 6 ++++++ src/smbus.c | 6 ++++++ 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/kernel/busses/i2c-isa.c b/kernel/busses/i2c-isa.c index 1a5daf91..176f54e8 100644 --- a/kernel/busses/i2c-isa.c +++ b/kernel/busses/i2c-isa.c @@ -75,28 +75,34 @@ static int isa_initialized; int isa_master_xfer (struct isa_adapter *adap, struct i2c_msg msgs[], int num) { +#ifdef DEBUG printk("isa.o: isa_master_xfer called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_send call-back implementation. Can't do that... */ int isa_slave_send (struct isa_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("isa.o: isa_slave_send called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_recv call-back implementation. Can't do that... */ int isa_slave_recv (struct isa_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("isa.o: isa_slave_recv called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Here we can put additional calls to modify the workings of the algorithm. diff --git a/kernel/i2c-proc.c b/kernel/i2c-proc.c index ab6304af..8b298a0a 100644 --- a/kernel/i2c-proc.c +++ b/kernel/i2c-proc.c @@ -84,9 +84,6 @@ static struct proc_dir_entry proc_bus_i2c_dir = /* size */ 0, /* ops */ NULL, /* get_info */ &read_bus_i2c -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) - /* fill_inode */ &monitor_bus_i2c -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ }; /* List of registered entries in /proc/bus */ diff --git a/kernel/smbus.c b/kernel/smbus.c index d33a12cc..669e7416 100644 --- a/kernel/smbus.c +++ b/kernel/smbus.c @@ -187,28 +187,34 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, int smbus_master_xfer (struct smbus_adapter *adap, struct i2c_msg msgs[], int num) { +#ifdef DEBUG printk("smbus.o: smbus_master_xfer called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_send call-back implementation. Can't do that... */ int smbus_slave_send (struct smbus_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("smbus.o: smbus_slave_send called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_recv call-back implementation. Can't do that... */ int smbus_slave_recv (struct smbus_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("smbus.o: smbus_slave_recv called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Here we can put additional calls to modify the workings of the algorithm. diff --git a/src/i2c-proc.c b/src/i2c-proc.c index ab6304af..8b298a0a 100644 --- a/src/i2c-proc.c +++ b/src/i2c-proc.c @@ -84,9 +84,6 @@ static struct proc_dir_entry proc_bus_i2c_dir = /* size */ 0, /* ops */ NULL, /* get_info */ &read_bus_i2c -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) - /* fill_inode */ &monitor_bus_i2c -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ }; /* List of registered entries in /proc/bus */ diff --git a/src/isa.c b/src/isa.c index 1a5daf91..176f54e8 100644 --- a/src/isa.c +++ b/src/isa.c @@ -75,28 +75,34 @@ static int isa_initialized; int isa_master_xfer (struct isa_adapter *adap, struct i2c_msg msgs[], int num) { +#ifdef DEBUG printk("isa.o: isa_master_xfer called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_send call-back implementation. Can't do that... */ int isa_slave_send (struct isa_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("isa.o: isa_slave_send called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_recv call-back implementation. Can't do that... */ int isa_slave_recv (struct isa_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("isa.o: isa_slave_recv called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Here we can put additional calls to modify the workings of the algorithm. diff --git a/src/smbus.c b/src/smbus.c index d33a12cc..669e7416 100644 --- a/src/smbus.c +++ b/src/smbus.c @@ -187,28 +187,34 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, int smbus_master_xfer (struct smbus_adapter *adap, struct i2c_msg msgs[], int num) { +#ifdef DEBUG printk("smbus.o: smbus_master_xfer called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_send call-back implementation. Can't do that... */ int smbus_slave_send (struct smbus_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("smbus.o: smbus_slave_send called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Algorithm slave_recv call-back implementation. Can't do that... */ int smbus_slave_recv (struct smbus_adapter *adap, char *data, int len) { +#ifdef DEBUG printk("smbus.o: smbus_slave_recv called for adapter `%s' " "(no i2c level access possible!)\n", adap->name); return -1; +#endif } /* Here we can put additional calls to modify the workings of the algorithm.