Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=745647e7a2ae399f7f70aca47827e62c99c893b5
Commit:     745647e7a2ae399f7f70aca47827e62c99c893b5
Parent:     69e2b602966533256edce1ed1b24fec23fe05962
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sat Sep 8 14:09:19 2007 +0200
Committer:  Stefan Richter <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 23:59:57 2007 +0200

    ieee1394: pcilynx: I2C cleanups
    
    * Delete optional and empty i2c client_register and client_unregister
      callbacks.
    * Use the proper i2c adapter ID.
    * Don't use a template to initialize the i2c_adapter structure, it's
      inefficient.
    * Update a misleading comment on why we use i2c_transfer rather than
      higher level i2c functions.
    
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
---
 drivers/ieee1394/pcilynx.c |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
index 7762e43..8af01ab 100644
--- a/drivers/ieee1394/pcilynx.c
+++ b/drivers/ieee1394/pcilynx.c
@@ -121,16 +121,6 @@ static int bit_getsda(void *data)
        return reg_read((struct ti_lynx *) data, SERIAL_EEPROM_CONTROL) & 
0x00000010;
 }
 
-static int bit_reg(struct i2c_client *client)
-{
-       return 0;
-}
-
-static int bit_unreg(struct i2c_client *client)
-{
-       return 0;
-}
-
 static struct i2c_algo_bit_data bit_data = {
        .setsda                 = bit_setsda,
        .setscl                 = bit_setscl,
@@ -140,14 +130,6 @@ static struct i2c_algo_bit_data bit_data = {
        .timeout                = 100,
 };
 
-static struct i2c_adapter bit_ops = {
-       .id                     = 0xAA, //FIXME: probably we should get an id 
in i2c-id.h
-       .client_register        = bit_reg,
-       .client_unregister      = bit_unreg,
-       .name                   = "PCILynx I2C",
-};
-
-
 
 /*
  * PCL handling functions.
@@ -1435,9 +1417,11 @@ static int __devinit add_card(struct pci_dev *dev,
                struct i2c_algo_bit_data i2c_adapter_data;
 
                error = -ENOMEM;
-               i2c_ad = kmemdup(&bit_ops, sizeof(*i2c_ad), GFP_KERNEL);
+               i2c_ad = kzalloc(sizeof(*i2c_ad), GFP_KERNEL);
                if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
 
+               i2c_ad->id = I2C_HW_B_PCILYNX;
+               strlcpy(i2c_ad->name, "PCILynx I2C", sizeof(i2c_ad->name));
                 i2c_adapter_data = bit_data;
                 i2c_ad->algo_data = &i2c_adapter_data;
                 i2c_adapter_data.data = lynx;
@@ -1464,8 +1448,8 @@ static int __devinit add_card(struct pci_dev *dev,
                                                   { 0x50, I2C_M_RD, 20, 
(unsigned char*) lynx->bus_info_block }
                                                 };
 
-                        /* we use i2c_transfer, because 
i2c_smbus_read_block_data does not work properly and we
-                           do it more efficiently in one transaction rather 
then using several reads */
+                       /* we use i2c_transfer because we have no i2c_client
+                          at hand */
                         if (i2c_transfer(i2c_ad, msg, 2) < 0) {
                                 PRINT(KERN_ERR, lynx->id, "unable to read bus 
info block from i2c");
                         } else {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to