From: Alex Elder Date: Mon, 6 Oct 2014 11:53:13 +0000 (-0500) Subject: greybus: get rid of gbuf->hdpriv X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~2030 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e8caf9a31b90d7c596cfcd5810dbf6910f3cbcc6;p=karo-tx-linux.git greybus: get rid of gbuf->hdpriv Last time I tried to kill off gbuf->context my efforts were shot down. Now that I've got the connection infrastructure in place, maybe I'll have more luck getting rid of gbuf->hdpriv. The only place it's used is to stash the es1_ap_dev structure pointer in the buffer. But that information is now available through the buffer's connection, so we don't need to use the hdpriv field any more. So get rid of it, and use hd_to_es1(gbuf->connection->hd) to get at what we need. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es1-ap-usb.c b/drivers/staging/greybus/es1-ap-usb.c index ef0ac7f424cf..97dd9b6a2bc1 100644 --- a/drivers/staging/greybus/es1-ap-usb.c +++ b/drivers/staging/greybus/es1-ap-usb.c @@ -96,7 +96,6 @@ static void cport_out_callback(struct urb *urb); static int alloc_gbuf_data(struct gbuf *gbuf, unsigned int size, gfp_t gfp_mask) { - struct es1_ap_dev *es1 = hd_to_es1(gbuf->connection->hd); u32 cport_reserve = gbuf->outbound ? 1 : 0; u8 *buffer; @@ -135,9 +134,6 @@ static int alloc_gbuf_data(struct gbuf *gbuf, unsigned int size, gbuf->transfer_buffer = buffer; gbuf->transfer_buffer_length = size; - /* When we send the gbuf, we need this pointer to be here */ - gbuf->hdpriv = es1; - return 0; } @@ -337,7 +333,7 @@ exit: static void cport_out_callback(struct urb *urb) { struct gbuf *gbuf = urb->context; - struct es1_ap_dev *es1 = gbuf->hdpriv; + struct es1_ap_dev *es1 = hd_to_es1(gbuf->connection->hd); unsigned long flags; int i; diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 12a6cbf15b9e..851f5ae095cc 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -124,7 +124,6 @@ typedef void (*gbuf_complete_t)(struct gbuf *gbuf); struct gbuf { struct kref kref; - void *hdpriv; struct gb_connection *connection; int status;