greybus: operation: remove gb_operation_destroy
authorJohan Hovold <johan@hovoldconsulting.com>
Sun, 27 Sep 2015 00:59:15 +0000 (17:59 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 29 Sep 2015 17:14:26 +0000 (19:14 +0200)
Remove legacy interface to "destroy" operations, which is now just a
wrapper for gb_operation_put.

The old interface name hides the fact that all operations are refcounted
and may live on even after having "destroyed" them.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/hid.c
drivers/staging/greybus/i2c.c
drivers/staging/greybus/loopback.c
drivers/staging/greybus/operation.c
drivers/staging/greybus/operation.h
drivers/staging/greybus/spi.c

index 0044b844c3e9578f177385d04b73806ec6c1869c..a2f0612076d573534b35f6a2d10eb772a4566e62 100644 (file)
@@ -92,7 +92,8 @@ static int gb_hid_set_report(struct gb_hid *ghid, u8 report_type, u8 report_id,
                ret = len;
        }
 
-       gb_operation_destroy(operation);
+       gb_operation_put(operation);
+
        return ret;
 }
 
index 75b92d68303675c9a690c2e7f0ace5ddc65c97bf..bf6d11b36b8394f7b08216168463e3d1e35356f5 100644 (file)
@@ -218,7 +218,8 @@ static int gb_i2c_transfer_operation(struct gb_i2c_device *gb_i2c_dev,
        } else if (!gb_i2c_expected_transfer_error(ret)) {
                pr_err("transfer operation failed (%d)\n", ret);
        }
-       gb_operation_destroy(operation);
+
+       gb_operation_put(operation);
 
        return ret;
 }
index 5a6354eb4ea962745a097d6b3f3c2d8c34514510..5cbb8cb7fd9b7d903a87d015d3a655d2d793b4c1 100644 (file)
@@ -402,7 +402,8 @@ static int gb_loopback_operation_sync(struct gb_loopback *gb, int type,
                                response_size);
                }
        }
-       gb_operation_destroy(operation);
+
+       gb_operation_put(operation);
 
 error:
        do_gettimeofday(&te);
index d159831f1421712820c7ba49d281a75ae58b9019..fae6ee9071df019a69568a4215a7f88bf0e04ea3 100644 (file)
@@ -1035,7 +1035,8 @@ int gb_operation_sync_timeout(struct gb_connection *connection, int type,
                               response_size);
                }
        }
-       gb_operation_destroy(operation);
+
+       gb_operation_put(operation);
 
        return ret;
 }
index 16488d016943ffb88f72d70097da35909dad1f1a..0f44ec844106c155a82704bb221d228c85e40a22 100644 (file)
@@ -131,10 +131,6 @@ struct gb_operation *gb_operation_create(struct gb_connection *connection,
                                        gfp_t gfp);
 void gb_operation_get(struct gb_operation *operation);
 void gb_operation_put(struct gb_operation *operation);
-static inline void gb_operation_destroy(struct gb_operation *operation)
-{
-       gb_operation_put(operation);
-}
 
 bool gb_operation_response_alloc(struct gb_operation *operation,
                                        size_t response_size, gfp_t gfp);
index e5d216646b9c3a08513831c059232d2ff1a6ec61..393f28ad099b2442b00f12b10470539e7d0f47b7 100644 (file)
@@ -156,7 +156,8 @@ static int gb_spi_transfer_one_message(struct spi_master *master,
        } else {
                pr_err("transfer operation failed (%d)\n", ret);
        }
-       gb_operation_destroy(operation);
+
+       gb_operation_put(operation);
 
        msg->actual_length = len;
        msg->status = 0;