greybus: remove gb_i2c_retries_operation
authorMichael Mogenson <michael.mogenson@leaflabs.com>
Thu, 3 Mar 2016 21:23:12 +0000 (16:23 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 3 Mar 2016 21:46:02 +0000 (13:46 -0800)
Set retries operation was removed from the Greybus specification. Remove
gb_i2c_retries_operation and all other no longer necessary code bits from the
Greybus kernel code.

Signed-off-by: Michael Mogenson <michael.mogenson@leaflabs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/greybus_protocols.h
drivers/staging/greybus/i2c.c

index f1b5cf6d0b87d2c5d6efcd1707a0d037e938d484..b60c7dc0e6dcdccbf8b095757e0b1a3cf1b9c8a9 100644 (file)
@@ -495,21 +495,13 @@ struct gb_hid_input_report_request {
 
 /* Greybus i2c request types */
 #define GB_I2C_TYPE_FUNCTIONALITY      0x02
-#define GB_I2C_TYPE_RETRIES            0x04
 #define GB_I2C_TYPE_TRANSFER           0x05
 
-#define GB_I2C_RETRIES_DEFAULT         3
-
 /* functionality request has no payload */
 struct gb_i2c_functionality_response {
        __le32  functionality;
 } __packed;
 
-struct gb_i2c_retries_request {
-       __u8    retries;
-} __packed;
-/* retries response has no payload */
-
 /*
  * Outgoing data immediately follows the op count and ops array.
  * The data for each write (master -> slave) op in the array is sent
index d9d483dc1c857085b6b05931227d8afd9e083fd0..cb68b455f8332397f13e179caf1a9b0bc6b4784e 100644 (file)
@@ -18,7 +18,6 @@ struct gb_i2c_device {
        struct gb_connection    *connection;
 
        u32                     functionality;
-       u8                      retries;
 
        struct i2c_adapter      adapter;
 };
@@ -49,25 +48,6 @@ static int gb_i2c_functionality_operation(struct gb_i2c_device *gb_i2c_dev)
        return 0;
 }
 
-static int gb_i2c_retries_operation(struct gb_i2c_device *gb_i2c_dev,
-                               u8 retries)
-{
-       struct device *dev = &gb_i2c_dev->connection->bundle->dev;
-       struct gb_i2c_retries_request request;
-       int ret;
-
-       request.retries = retries;
-       ret = gb_operation_sync(gb_i2c_dev->connection, GB_I2C_TYPE_RETRIES,
-                               &request, sizeof(request), NULL, 0);
-       if (ret)
-               dev_err(dev, "retries operation failed (%d)\n", ret);
-       else
-               gb_i2c_dev->retries = retries;
-
-       return ret;
-}
-
-
 /*
  * Map Linux i2c_msg flags into Greybus i2c transfer op flags.
  */
@@ -249,22 +229,14 @@ static const struct i2c_algorithm gb_i2c_algorithm = {
 /*
  * Do initial setup of the i2c device.  This includes verifying we
  * can support it (based on the protocol version it advertises).
- * If that's OK, we get and cached its functionality bits and
- * set up the retry count.
+ * If that's OK, we get and cached its functionality bits.
  *
  * Note: gb_i2c_dev->connection is assumed to have been valid.
  */
 static int gb_i2c_device_setup(struct gb_i2c_device *gb_i2c_dev)
 {
-       int ret;
-
        /* Assume the functionality never changes, just get it once */
-       ret = gb_i2c_functionality_operation(gb_i2c_dev);
-       if (ret)
-               return ret;
-
-       /* Set up our default retry count */
-       return gb_i2c_retries_operation(gb_i2c_dev, GB_I2C_RETRIES_DEFAULT);
+       return gb_i2c_functionality_operation(gb_i2c_dev);
 }
 
 static int gb_i2c_connection_init(struct gb_connection *connection)
@@ -290,7 +262,6 @@ static int gb_i2c_connection_init(struct gb_connection *connection)
        adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
        adapter->algo = &gb_i2c_algorithm;
        /* adapter->algo_data = what? */
-       adapter->retries = gb_i2c_dev->retries;
 
        adapter->dev.parent = &connection->bundle->dev;
        snprintf(adapter->name, sizeof(adapter->name), "Greybus i2c adapter");