]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: drop hd arg from submit_gbuf method
authorAlex Elder <elder@linaro.org>
Thu, 16 Oct 2014 11:35:29 +0000 (06:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:13:15 +0000 (18:13 +0200)
Every gbuf is associated with a connection when it is created.  And
a connection contains a pointer to the host device that will carry
messages.  So there's no need for the submit_gbuf() method to have
the host device pointer passed to it, the function can get it from
the gbuf's connection.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/es1-ap-usb.c
drivers/staging/greybus/gbuf.c
drivers/staging/greybus/greybus.h

index 2405670d8afcbd4e24eca0cb40c1cbb3e789fd5c..5acf5a75e44bdaf7a22ff5958447a1732ee6ec94 100644 (file)
@@ -206,9 +206,9 @@ static struct urb *next_free_urb(struct es1_ap_dev *es1, gfp_t gfp_mask)
        return urb;
 }
 
-static int submit_gbuf(struct gbuf *gbuf, struct greybus_host_device *hd,
-                      gfp_t gfp_mask)
+static int submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask)
 {
+       struct greybus_host_device *hd = gbuf->connection->hd;
        struct es1_ap_dev *es1 = hd_to_es1(hd);
        struct usb_device *udev = es1->usb_dev;
        int retval;
index a33dbb417312451ef1bd3be75a864054ea37eb8d..6580deb5dbe8bcb442745c7344e691736f388afb 100644 (file)
@@ -105,7 +105,7 @@ int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask)
 {
        struct greybus_host_device *hd = gbuf->connection->hd;
 
-       return hd->driver->submit_gbuf(gbuf, hd, gfp_mask);
+       return hd->driver->submit_gbuf(gbuf, gfp_mask);
 }
 
 int greybus_kill_gbuf(struct gbuf *gbuf)
index 39ccdc4a63a8f62ce37da02df67d546ba9f6d280..033c7abe96f045910ff2d87f3a0793f1d871ae8b 100644 (file)
@@ -169,8 +169,7 @@ struct greybus_host_driver {
        void (*free_gbuf_data)(struct gbuf *gbuf);
        int (*submit_svc)(struct svc_msg *svc_msg,
                            struct greybus_host_device *hd);
-       int (*submit_gbuf)(struct gbuf *gbuf, struct greybus_host_device *hd,
-                          gfp_t gfp_mask);
+       int (*submit_gbuf)(struct gbuf *gbuf, gfp_t gfp_mask);
 };
 
 struct greybus_host_device {