From 831b8e88f3ce0d9afc30603d376b587653409bb8 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Sun, 6 Dec 1998 16:07:23 +0000 Subject: [PATCH] Resolved ISA crash. Status: You can insert all modules, and it works like a charm! Changes: * Corrected check for SMBus algorithm in smbus_access * (The unimplemented) smbus_access_i2c now returns an error, instead of an undefined result git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@41 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/smbus.c | 11 +++++++---- src/smbus.c | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/kernel/smbus.c b/kernel/smbus.c index f51ab649..125c604b 100644 --- a/kernel/smbus.c +++ b/kernel/smbus.c @@ -74,7 +74,7 @@ s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, u8 command, int size, union smbus_data * data) { int res; - if (adapter->id & ALGO_SMBUS) { + if ((adapter->id & ALGO_MASK) == ALGO_SMBUS) { #ifdef SPINLOCK spin_lock_irqsave(&adapter->lock,adapter->lockflags); #else @@ -87,7 +87,7 @@ s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, #else up(&adapter->lock); #endif - } else + } else res = smbus_access_i2c(adapter,addr,read_write,command,size,data); return res; } @@ -100,7 +100,10 @@ s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, u8 command, int size, union smbus_data * data) { - /* So we need to generate a series of msgs */ + /* For now */ + return -1; + + /* So we need to generate a series of msgs struct i2c_msg msg[2]; char msgbuf0[2]; char msgbuf1[32]; @@ -108,7 +111,7 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, msg[0].flags = read_write; msg[0].len = 0; msg[0].buf = msgbuf0; - /* WHATEVER */ + WHATEVER */ } /* Algorithm master_xfer call-back implementation. Can't do that... */ diff --git a/src/smbus.c b/src/smbus.c index f51ab649..125c604b 100644 --- a/src/smbus.c +++ b/src/smbus.c @@ -74,7 +74,7 @@ s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, u8 command, int size, union smbus_data * data) { int res; - if (adapter->id & ALGO_SMBUS) { + if ((adapter->id & ALGO_MASK) == ALGO_SMBUS) { #ifdef SPINLOCK spin_lock_irqsave(&adapter->lock,adapter->lockflags); #else @@ -87,7 +87,7 @@ s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, #else up(&adapter->lock); #endif - } else + } else res = smbus_access_i2c(adapter,addr,read_write,command,size,data); return res; } @@ -100,7 +100,10 @@ s32 smbus_access (struct i2c_adapter * adapter, u8 addr, char read_write, s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, u8 command, int size, union smbus_data * data) { - /* So we need to generate a series of msgs */ + /* For now */ + return -1; + + /* So we need to generate a series of msgs struct i2c_msg msg[2]; char msgbuf0[2]; char msgbuf1[32]; @@ -108,7 +111,7 @@ s32 smbus_access_i2c(struct i2c_adapter * adapter, u8 addr, char read_write, msg[0].flags = read_write; msg[0].len = 0; msg[0].buf = msgbuf0; - /* WHATEVER */ + WHATEVER */ } /* Algorithm master_xfer call-back implementation. Can't do that... */