Skip to contentSkip to conversation

Cleanups to the recent smbus functions removal

PATCH New Jean Delvare 3 participants 4 messages May 19, 2005 I2C

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cleanups to the recent smbus functions removal

Hi Greg, all,

This patch cleans up the recent removal of smbus functions proposed by Arjan and then fixed by Gabriel. Changes are as follow:

1* Discard i2c_smbus_block_process_call, as it isn't used anywhere
either. I guess that Arjan missed it because it wasn't exported.

2* Document the functions removal, so that people have at least an idea
that the functions can be restored later if needed.

Maybe it would make sense to apply this before 2.6.10-rc2? Not critical however, I agree. But obviously safe too, huh? ;)

Thanks.

Documentation/i2c/writing-clients renamed from Documentation/i2c/writing-clients.orig +16 -4
@@ -676,14 +676,26 @@
   extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
   extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
                                        u8 command, u16 value);
-  extern s32 i2c_smbus_process_call(struct i2c_client * client,
-                                    u8 command, u16 value);
-  extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
-                                       u8 command, u8 *values);
   extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
                                         u8 command, u8 length,
                                         u8 *values);
 
+These ones were removed in Linux 2.6.10 because they had no users, but could
+be added back later if needed:
+
+  extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
+                                           u8 command, u8 *values);
+  extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
+                                       u8 command, u8 *values);
+  extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
+                                            u8 command, u8 length,
+                                            u8 *values);
+  extern s32 i2c_smbus_process_call(struct i2c_client * client,
+                                    u8 command, u16 value);
+  extern s32 i2c_smbus_block_process_call(struct i2c_client *client,
+                                          u8 command, u8 length,
+                                          u8 *values)
+
 All these transactions return -1 on failure. The 'write' transactions 
 return 0 on success; the 'read' transactions return the read value, except 
 for read_block, which returns the number of values read. The block buffers 
drivers/i2c/i2c-core.c renamed from drivers/i2c/i2c-core.c.orig +0 -19
@@ -1038,25 +1038,6 @@
 }
 
 /* Returns the number of read bytes */
-s32 i2c_smbus_block_process_call(struct i2c_client *client, u8 command, u8 length, u8 *values)
-{
-	union i2c_smbus_data data;
-	int i;
-	if (length > I2C_SMBUS_BLOCK_MAX - 1)
-		return -1;
-	data.block[0] = length;
-	for (i = 1; i <= length; i++)
-		data.block[i] = values[i-1];
-	if(i2c_smbus_xfer(client->adapter,client->addr,client->flags,
-	                  I2C_SMBUS_WRITE, command,
-	                  I2C_SMBUS_BLOCK_PROC_CALL, &data))
-		return -1;
-	for (i = 1; i <= data.block[0]; i++)
-		values[i-1] = data.block[i];
-	return data.block[0];
-}
-
-/* Returns the number of read bytes */
 s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, u8 command, u8 *values)
 {
 	union i2c_smbus_data data;

--
Jean Delvare
http://khali.linux-fr.org/

#1 lore raw

PATCH 1/1 Cleanups to the recent smbus functions removal

Hi Jean,

Quoted 5 lines · Jean Delvare

Hi Greg, all,

This patch cleans up the recent removal of smbus functions proposed by Arjan and then fixed by Gabriel. Changes are as follow:

Quoted 8 lines

1* Discard i2c_smbus_block_process_call, as it isn't used anywhere
either. I guess that Arjan missed it because it wasn't exported.

2* Document the functions removal, so that people have at least an idea
that the functions can be restored later if needed.

Maybe it would make sense to apply this before 2.6.10-rc2? Not critical however, I agree. But obviously safe too, huh? ;)

It seems so. BTW I hate wrong comments and happened to add one in my patch. To fix my blunder, can you apply the appended one line removal on top of Jean's patch.

Thanks,
Gabriel

=== drivers/i2c/i2c-core.c 1.60 vs edited ==--- 1.60/drivers/i2c/i2c-core.c 2004-11-11 18:33:23 +01:00
+++ edited/drivers/i2c/i2c-core.c 2004-11-17 12:18:35 +01:00
@@ -1021,7 +1021,6 @@
I2C_SMBUS_WORD_DATA,&data);
}

-/* Returns the number of bytes transferred */
s32 i2c_smbus_write_block_data(struct i2c_client *client, u8 command,
u8 length, u8 *values)
{

Applied
#2 lore raw

PATCH 1/1 Cleanups to the recent smbus functions removal

In reply to Jean Delvare
Quoted 11 lines · Jean Delvare

Hi Greg, all,

This patch cleans up the recent removal of smbus functions proposed by Arjan and then fixed by Gabriel. Changes are as follow:

1* Discard i2c_smbus_block_process_call, as it isn't used anywhere
either. I guess that Arjan missed it because it wasn't exported.

2* Document the functions removal, so that people have at least an idea
that the functions can be restored later if needed.

Quoted 6 lines

Maybe it would make sense to apply this before 2.6.10-rc2? Not critical however, I agree. But obviously safe too, huh? ;)

Thanks.

Applied, thanks.

greg k-h

Applied
#3 lore raw

PATCH 1/1 Cleanups to the recent smbus functions removal

In reply to Jean Delvare
Quoted 14 lines · Gabriel Paubert

Hi Jean,

Quoted 11 lines · Jean Delvare

Hi Greg, all,

This patch cleans up the recent removal of smbus functions proposed by Arjan and then fixed by Gabriel. Changes are as follow:

1* Discard i2c_smbus_block_process_call, as it isn't used anywhere
either. I guess that Arjan missed it because it wasn't exported.

2* Document the functions removal, so that people have at least an idea
that the functions can be restored later if needed.

Quoted 6 lines
Quoted 2 lines

Maybe it would make sense to apply this before 2.6.10-rc2? Not critical however, I agree. But obviously safe too, huh? ;)

It seems so. BTW I hate wrong comments and happened to add one in my patch. To fix my blunder, can you apply the appended one line removal on top of Jean's patch.

Applied, thanks.

greg k-h