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
This commit is contained in:
Frodo Looijaard committed 1998-12-06 16:07:23 +00:00
1 parent ce0521ba13
commit 831b8e88f3
2 files changed
+14 -8

No files matched your search

+7 -4
View File
@@ -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... */
+7 -4
View File
@@ -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... */