From 2537636abae5b81a1de5ad7511a29306f39b2167 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 3 Nov 2015 18:03:23 +0100 Subject: [PATCH] greybus: hd: rename host-device structure Rename host-device structure gb_host_device to match our other structures. Signed-off-by: Johan Hovold Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/connection.c | 18 +++++++++--------- drivers/staging/greybus/connection.h | 6 +++--- drivers/staging/greybus/endo.c | 12 ++++++------ drivers/staging/greybus/endo.h | 6 +++--- drivers/staging/greybus/es1.c | 20 ++++++++++---------- drivers/staging/greybus/es2.c | 24 ++++++++++++------------ drivers/staging/greybus/greybus.h | 2 +- drivers/staging/greybus/greybus_trace.h | 8 ++++---- drivers/staging/greybus/hd.c | 10 +++++----- drivers/staging/greybus/hd.h | 19 +++++++++---------- drivers/staging/greybus/interface.c | 6 +++--- drivers/staging/greybus/interface.h | 10 +++++----- drivers/staging/greybus/module.c | 2 +- drivers/staging/greybus/module.h | 4 ++-- drivers/staging/greybus/operation.c | 14 +++++++------- drivers/staging/greybus/operation.h | 2 +- drivers/staging/greybus/svc.c | 14 +++++++------- drivers/staging/greybus/svc.h | 4 ++-- 18 files changed, 90 insertions(+), 91 deletions(-) diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c index de774b9..96dabf7 100644 --- a/drivers/staging/greybus/connection.c +++ b/drivers/staging/greybus/connection.c @@ -17,7 +17,7 @@ static DEFINE_SPINLOCK(gb_connections_lock); static struct gb_connection * gb_connection_intf_find(struct gb_interface *intf, u16 cport_id) { - struct greybus_host_device *hd = intf->hd; + struct gb_host_device *hd = intf->hd; struct gb_connection *connection; list_for_each_entry(connection, &hd->connections, hd_links) @@ -28,7 +28,7 @@ gb_connection_intf_find(struct gb_interface *intf, u16 cport_id) } static struct gb_connection * -gb_connection_hd_find(struct greybus_host_device *hd, u16 cport_id) +gb_connection_hd_find(struct gb_host_device *hd, u16 cport_id) { struct gb_connection *connection; unsigned long flags; @@ -48,7 +48,7 @@ found: * Callback from the host driver to let us know that data has been * received on the bundle. */ -void greybus_data_rcvd(struct greybus_host_device *hd, u16 cport_id, +void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id, u8 *data, size_t length) { struct gb_connection *connection; @@ -105,7 +105,7 @@ int svc_update_connection(struct gb_interface *intf, * pointer otherwise. */ struct gb_connection * -gb_connection_create_range(struct greybus_host_device *hd, +gb_connection_create_range(struct gb_host_device *hd, struct gb_bundle *bundle, struct device *parent, u16 cport_id, u8 protocol_id, u32 ida_start, u32 ida_end) @@ -188,7 +188,7 @@ err_remove_ida: static int gb_connection_hd_cport_enable(struct gb_connection *connection) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; int ret; if (!hd->driver->cport_enable) @@ -206,7 +206,7 @@ static int gb_connection_hd_cport_enable(struct gb_connection *connection) static void gb_connection_hd_cport_disable(struct gb_connection *connection) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; if (!hd->driver->cport_disable) return; @@ -258,7 +258,7 @@ static void gb_connection_cancel_operations(struct gb_connection *connection, static int gb_connection_svc_connection_create(struct gb_connection *connection) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; struct gb_protocol *protocol = connection->protocol; struct gb_interface *intf; int ret; @@ -459,7 +459,7 @@ void gb_connection_destroy(struct gb_connection *connection) void gb_connection_latency_tag_enable(struct gb_connection *connection) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; int ret; if (!hd->driver->latency_tag_enable) @@ -475,7 +475,7 @@ EXPORT_SYMBOL_GPL(gb_connection_latency_tag_enable); void gb_connection_latency_tag_disable(struct gb_connection *connection) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; int ret; if (!hd->driver->latency_tag_disable) diff --git a/drivers/staging/greybus/connection.h b/drivers/staging/greybus/connection.h index 06c7711..6163082 100644 --- a/drivers/staging/greybus/connection.h +++ b/drivers/staging/greybus/connection.h @@ -22,7 +22,7 @@ enum gb_connection_state { }; struct gb_connection { - struct greybus_host_device *hd; + struct gb_host_device *hd; struct gb_bundle *bundle; struct kref kref; u16 hd_cport_id; @@ -53,13 +53,13 @@ int svc_update_connection(struct gb_interface *intf, struct gb_connection *connection); struct gb_connection *gb_connection_create(struct gb_bundle *bundle, u16 cport_id, u8 protocol_id); -struct gb_connection *gb_connection_create_range(struct greybus_host_device *hd, +struct gb_connection *gb_connection_create_range(struct gb_host_device *hd, struct gb_bundle *bundle, struct device *parent, u16 cport_id, u8 protocol_id, u32 ida_start, u32 ida_end); void gb_connection_destroy(struct gb_connection *connection); -void greybus_data_rcvd(struct greybus_host_device *hd, u16 cport_id, +void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id, u8 *data, size_t length); int gb_connection_bind_protocol(struct gb_connection *connection); diff --git a/drivers/staging/greybus/endo.c b/drivers/staging/greybus/endo.c index 7f24c79..df4afb2 100644 --- a/drivers/staging/greybus/endo.c +++ b/drivers/staging/greybus/endo.c @@ -191,7 +191,7 @@ static bool single_cross_rib(u8 left_ribs, u8 right_ribs) * - Bit 1: 2nd rib location from top, i.e. between interface 2 and 3. * - Bit 2: 3rd rib location from top, i.e. between interface 3 and 4. */ -static bool validate_front_ribs(struct greybus_host_device *hd, +static bool validate_front_ribs(struct gb_host_device *hd, struct endo_layout *layout, bool mini, u16 endo_id) { @@ -254,7 +254,7 @@ static bool validate_front_ribs(struct greybus_host_device *hd, * its rotational orientation. We define one canonical id to represent a * particular endo configuration. */ -static bool validate_back_ribs(struct greybus_host_device *hd, +static bool validate_back_ribs(struct gb_host_device *hd, struct endo_layout *layout, u16 endo_id) { u8 max_ribs = layout->max_ribs; @@ -320,7 +320,7 @@ static bool validate_back_ribs(struct greybus_host_device *hd, * Validate the endo-id passed from SVC. Error out if its not a valid Endo, * else return structure representing ribs positions on front and back of Endo. */ -static int gb_endo_validate_id(struct greybus_host_device *hd, +static int gb_endo_validate_id(struct gb_host_device *hd, struct endo_layout *layout, u16 endo_id) { /* Validate Endo Size */ @@ -435,7 +435,7 @@ static int create_modules(struct gb_endo *endo) return 0; } -static int gb_endo_register(struct greybus_host_device *hd, +static int gb_endo_register(struct gb_host_device *hd, struct gb_endo *endo) { int dev_id; @@ -471,7 +471,7 @@ static int gb_endo_register(struct greybus_host_device *hd, return retval; } -struct gb_endo *gb_endo_create(struct greybus_host_device *hd, u16 endo_id, +struct gb_endo *gb_endo_create(struct gb_host_device *hd, u16 endo_id, u8 ap_intf_id) { struct gb_endo *endo; @@ -524,7 +524,7 @@ void gb_endo_remove(struct gb_endo *endo) device_unregister(&endo->dev); } -int greybus_endo_setup(struct greybus_host_device *hd, u16 endo_id, +int greybus_endo_setup(struct gb_host_device *hd, u16 endo_id, u8 ap_intf_id) { struct gb_endo *endo; diff --git a/drivers/staging/greybus/endo.h b/drivers/staging/greybus/endo.h index 0b5384d..20a8649 100644 --- a/drivers/staging/greybus/endo.h +++ b/drivers/staging/greybus/endo.h @@ -47,15 +47,15 @@ struct gb_endo { #define to_gb_endo(d) container_of(d, struct gb_endo, dev) /* Greybus "private" definitions */ -struct greybus_host_device; +struct gb_host_device; int gb_endo_init(void); void gb_endo_exit(void); -struct gb_endo *gb_endo_create(struct greybus_host_device *hd, +struct gb_endo *gb_endo_create(struct gb_host_device *hd, u16 endo_id, u8 ap_intf_id); void gb_endo_remove(struct gb_endo *endo); -int greybus_endo_setup(struct greybus_host_device *hd, u16 endo_id, +int greybus_endo_setup(struct gb_host_device *hd, u16 endo_id, u8 ap_intf_id); u8 endo_get_module_id(struct gb_endo *endo, u8 interface_id); diff --git a/drivers/staging/greybus/es1.c b/drivers/staging/greybus/es1.c index ba025e7..07e1a14 100644 --- a/drivers/staging/greybus/es1.c +++ b/drivers/staging/greybus/es1.c @@ -60,7 +60,7 @@ static DEFINE_KFIFO(apb1_log_fifo, char, APB1_LOG_SIZE); * es1_ap_dev - ES1 USB Bridge to AP structure * @usb_dev: pointer to the USB device we are. * @usb_intf: pointer to the USB interface we are bound to. - * @hd: pointer to our greybus_host_device structure + * @hd: pointer to our gb_host_device structure * @cport_in_endpoint: bulk in endpoint for CPort data * @cport-out_endpoint: bulk out endpoint for CPort data * @cport_in_urb: array of urbs for the CPort in messages @@ -75,7 +75,7 @@ static DEFINE_KFIFO(apb1_log_fifo, char, APB1_LOG_SIZE); struct es1_ap_dev { struct usb_device *usb_dev; struct usb_interface *usb_intf; - struct greybus_host_device *hd; + struct gb_host_device *hd; __u8 cport_in_endpoint; __u8 cport_out_endpoint; @@ -88,7 +88,7 @@ struct es1_ap_dev { spinlock_t cport_out_urb_lock; }; -static inline struct es1_ap_dev *hd_to_es1(struct greybus_host_device *hd) +static inline struct es1_ap_dev *hd_to_es1(struct gb_host_device *hd) { return (struct es1_ap_dev *)&hd->hd_priv; } @@ -181,7 +181,7 @@ static u16 gb_message_cport_unpack(struct gb_operation_msg_hdr *header) * Returns zero if the message was successfully queued, or a negative errno * otherwise. */ -static int message_send(struct greybus_host_device *hd, u16 cport_id, +static int message_send(struct gb_host_device *hd, u16 cport_id, struct gb_message *message, gfp_t gfp_mask) { struct es1_ap_dev *es1 = hd_to_es1(hd); @@ -244,7 +244,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id, */ static void message_cancel(struct gb_message *message) { - struct greybus_host_device *hd = message->operation->connection->hd; + struct gb_host_device *hd = message->operation->connection->hd; struct es1_ap_dev *es1 = hd_to_es1(hd); struct urb *urb; int i; @@ -277,7 +277,7 @@ static void message_cancel(struct gb_message *message) usb_free_urb(urb); } -static int latency_tag_enable(struct greybus_host_device *hd, u16 cport_id) +static int latency_tag_enable(struct gb_host_device *hd, u16 cport_id) { int retval; struct es1_ap_dev *es1 = hd_to_es1(hd); @@ -301,7 +301,7 @@ static int latency_tag_enable(struct greybus_host_device *hd, u16 cport_id) return retval; } -static int latency_tag_disable(struct greybus_host_device *hd, u16 cport_id) +static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id) { int retval; struct es1_ap_dev *es1 = hd_to_es1(hd); @@ -403,7 +403,7 @@ static void ap_disconnect(struct usb_interface *interface) static void cport_in_callback(struct urb *urb) { - struct greybus_host_device *hd = urb->context; + struct gb_host_device *hd = urb->context; struct device *dev = &urb->dev->dev; struct gb_operation_msg_hdr *header; int status = check_urb_status(urb); @@ -443,7 +443,7 @@ exit: static void cport_out_callback(struct urb *urb) { struct gb_message *message = urb->context; - struct greybus_host_device *hd = message->operation->connection->hd; + struct gb_host_device *hd = message->operation->connection->hd; struct es1_ap_dev *es1 = hd_to_es1(hd); int status = check_urb_status(urb); unsigned long flags; @@ -599,7 +599,7 @@ static int ap_probe(struct usb_interface *interface, const struct usb_device_id *id) { struct es1_ap_dev *es1; - struct greybus_host_device *hd; + struct gb_host_device *hd; struct usb_device *udev; struct usb_host_interface *iface_desc; struct usb_endpoint_descriptor *endpoint; diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c index 870c9cb..8860f60 100644 --- a/drivers/staging/greybus/es2.c +++ b/drivers/staging/greybus/es2.c @@ -83,7 +83,7 @@ struct es2_cport_out { * es2_ap_dev - ES2 USB Bridge to AP structure * @usb_dev: pointer to the USB device we are. * @usb_intf: pointer to the USB interface we are bound to. - * @hd: pointer to our greybus_host_device structure + * @hd: pointer to our gb_host_device structure * @cport_in: endpoint, urbs and buffer for cport in messages * @cport_out: endpoint for for cport out messages @@ -102,7 +102,7 @@ struct es2_cport_out { struct es2_ap_dev { struct usb_device *usb_dev; struct usb_interface *usb_intf; - struct greybus_host_device *hd; + struct gb_host_device *hd; struct es2_cport_in cport_in[NUM_BULKS]; struct es2_cport_out cport_out[NUM_BULKS]; @@ -131,7 +131,7 @@ struct cport_to_ep { __u8 endpoint_out; }; -static inline struct es2_ap_dev *hd_to_es2(struct greybus_host_device *hd) +static inline struct es2_ap_dev *hd_to_es2(struct gb_host_device *hd) { return (struct es2_ap_dev *)&hd->hd_priv; } @@ -291,7 +291,7 @@ static u16 gb_message_cport_unpack(struct gb_operation_msg_hdr *header) * Returns zero if the message was successfully queued, or a negative errno * otherwise. */ -static int message_send(struct greybus_host_device *hd, u16 cport_id, +static int message_send(struct gb_host_device *hd, u16 cport_id, struct gb_message *message, gfp_t gfp_mask) { struct es2_ap_dev *es2 = hd_to_es2(hd); @@ -357,7 +357,7 @@ static int message_send(struct greybus_host_device *hd, u16 cport_id, */ static void message_cancel(struct gb_message *message) { - struct greybus_host_device *hd = message->operation->connection->hd; + struct gb_host_device *hd = message->operation->connection->hd; struct es2_ap_dev *es2 = hd_to_es2(hd); struct urb *urb; int i; @@ -390,7 +390,7 @@ static void message_cancel(struct gb_message *message) usb_free_urb(urb); } -static int cport_reset(struct greybus_host_device *hd, u16 cport_id) +static int cport_reset(struct gb_host_device *hd, u16 cport_id) { struct es2_ap_dev *es2 = hd_to_es2(hd); struct usb_device *udev = es2->usb_dev; @@ -410,7 +410,7 @@ static int cport_reset(struct greybus_host_device *hd, u16 cport_id) return 0; } -static int cport_enable(struct greybus_host_device *hd, u16 cport_id) +static int cport_enable(struct gb_host_device *hd, u16 cport_id) { int retval; @@ -423,7 +423,7 @@ static int cport_enable(struct greybus_host_device *hd, u16 cport_id) return 0; } -static int latency_tag_enable(struct greybus_host_device *hd, u16 cport_id) +static int latency_tag_enable(struct gb_host_device *hd, u16 cport_id) { int retval; struct es2_ap_dev *es2 = hd_to_es2(hd); @@ -447,7 +447,7 @@ static int latency_tag_enable(struct greybus_host_device *hd, u16 cport_id) return retval; } -static int latency_tag_disable(struct greybus_host_device *hd, u16 cport_id) +static int latency_tag_disable(struct gb_host_device *hd, u16 cport_id) { int retval; struct es2_ap_dev *es2 = hd_to_es2(hd); @@ -556,7 +556,7 @@ static void ap_disconnect(struct usb_interface *interface) static void cport_in_callback(struct urb *urb) { - struct greybus_host_device *hd = urb->context; + struct gb_host_device *hd = urb->context; struct device *dev = &urb->dev->dev; struct gb_operation_msg_hdr *header; int status = check_urb_status(urb); @@ -596,7 +596,7 @@ exit: static void cport_out_callback(struct urb *urb) { struct gb_message *message = urb->context; - struct greybus_host_device *hd = message->operation->connection->hd; + struct gb_host_device *hd = message->operation->connection->hd; struct es2_ap_dev *es2 = hd_to_es2(hd); int status = check_urb_status(urb); unsigned long flags; @@ -787,7 +787,7 @@ static int ap_probe(struct usb_interface *interface, const struct usb_device_id *id) { struct es2_ap_dev *es2; - struct greybus_host_device *hd; + struct gb_host_device *hd; struct usb_device *udev; struct usb_host_interface *iface_desc; struct usb_endpoint_descriptor *endpoint; diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 8eb63e0..1b6f56f 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -129,7 +129,7 @@ static inline int is_gb_bundle(const struct device *dev) return dev->type == &greybus_bundle_type; } -static inline bool cport_id_valid(struct greybus_host_device *hd, u16 cport_id) +static inline bool cport_id_valid(struct gb_host_device *hd, u16 cport_id) { return cport_id != CPORT_ID_BAD && cport_id < hd->num_cports; } diff --git a/drivers/staging/greybus/greybus_trace.h b/drivers/staging/greybus/greybus_trace.h index e5e3cc0..d38f9e0 100644 --- a/drivers/staging/greybus/greybus_trace.h +++ b/drivers/staging/greybus/greybus_trace.h @@ -15,7 +15,7 @@ #include struct gb_message; -struct greybus_host_device; +struct gb_host_device; DECLARE_EVENT_CLASS(gb_message, @@ -108,7 +108,7 @@ DEFINE_EVENT(gb_message, gb_message_cancel_incoming, DECLARE_EVENT_CLASS(gb_host_device, - TP_PROTO(struct greybus_host_device *hd, u16 intf_cport_id, + TP_PROTO(struct gb_host_device *hd, u16 intf_cport_id, size_t payload_size), TP_ARGS(hd, intf_cport_id, payload_size), @@ -136,7 +136,7 @@ DECLARE_EVENT_CLASS(gb_host_device, */ DEFINE_EVENT(gb_host_device, gb_host_device_send, - TP_PROTO(struct greybus_host_device *hd, u16 intf_cport_id, + TP_PROTO(struct gb_host_device *hd, u16 intf_cport_id, size_t payload_size), TP_ARGS(hd, intf_cport_id, payload_size) @@ -149,7 +149,7 @@ DEFINE_EVENT(gb_host_device, gb_host_device_send, */ DEFINE_EVENT(gb_host_device, gb_host_device_recv, - TP_PROTO(struct greybus_host_device *hd, u16 intf_cport_id, + TP_PROTO(struct gb_host_device *hd, u16 intf_cport_id, size_t payload_size), TP_ARGS(hd, intf_cport_id, payload_size) diff --git a/drivers/staging/greybus/hd.c b/drivers/staging/greybus/hd.c index 3ac8507..a09a920 100644 --- a/drivers/staging/greybus/hd.c +++ b/drivers/staging/greybus/hd.c @@ -19,21 +19,21 @@ static DEFINE_MUTEX(hd_mutex); static void free_hd(struct kref *kref) { - struct greybus_host_device *hd; + struct gb_host_device *hd; - hd = container_of(kref, struct greybus_host_device, kref); + hd = container_of(kref, struct gb_host_device, kref); ida_destroy(&hd->cport_id_map); kfree(hd); mutex_unlock(&hd_mutex); } -struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *driver, +struct gb_host_device *greybus_create_hd(struct greybus_host_driver *driver, struct device *parent, size_t buffer_size_max, size_t num_cports) { - struct greybus_host_device *hd; + struct gb_host_device *hd; /* * Validate that the driver implements all of the callbacks @@ -96,7 +96,7 @@ struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *driver } EXPORT_SYMBOL_GPL(greybus_create_hd); -void greybus_remove_hd(struct greybus_host_device *hd) +void greybus_remove_hd(struct gb_host_device *hd) { /* * Tear down all interfaces, modules, and the endo that is associated diff --git a/drivers/staging/greybus/hd.h b/drivers/staging/greybus/hd.h index df953d4..122790d 100644 --- a/drivers/staging/greybus/hd.h +++ b/drivers/staging/greybus/hd.h @@ -10,7 +10,7 @@ #ifndef __HD_H #define __HD_H -struct greybus_host_device; +struct gb_host_device; struct gb_message; /* Greybus "Host driver" structure, needed by a host controller driver to be @@ -19,17 +19,16 @@ struct gb_message; struct greybus_host_driver { size_t hd_priv_size; - int (*cport_enable)(struct greybus_host_device *hd, u16 cport_id); - int (*cport_disable)(struct greybus_host_device *hd, u16 cport_id); - int (*message_send)(struct greybus_host_device *hd, u16 dest_cport_id, + int (*cport_enable)(struct gb_host_device *hd, u16 cport_id); + int (*cport_disable)(struct gb_host_device *hd, u16 cport_id); + int (*message_send)(struct gb_host_device *hd, u16 dest_cport_id, struct gb_message *message, gfp_t gfp_mask); void (*message_cancel)(struct gb_message *message); - int (*latency_tag_enable)(struct greybus_host_device *hd, u16 cport_id); - int (*latency_tag_disable)(struct greybus_host_device *hd, - u16 cport_id); + int (*latency_tag_enable)(struct gb_host_device *hd, u16 cport_id); + int (*latency_tag_disable)(struct gb_host_device *hd, u16 cport_id); }; -struct greybus_host_device { +struct gb_host_device { struct kref kref; struct device *parent; const struct greybus_host_driver *driver; @@ -52,10 +51,10 @@ struct greybus_host_device { unsigned long hd_priv[0] __aligned(sizeof(s64)); }; -struct greybus_host_device *greybus_create_hd(struct greybus_host_driver *hd, +struct gb_host_device *greybus_create_hd(struct greybus_host_driver *hd, struct device *parent, size_t buffer_size_max, size_t num_cports); -void greybus_remove_hd(struct greybus_host_device *hd); +void greybus_remove_hd(struct gb_host_device *hd); #endif /* __HD_H */ diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c index 5d238d3..275a8c7 100644 --- a/drivers/staging/greybus/interface.c +++ b/drivers/staging/greybus/interface.c @@ -44,7 +44,7 @@ static DEFINE_SPINLOCK(gb_interfaces_lock); // FIXME, odds are you don't want to call this function, rework the caller to // not need it please. -struct gb_interface *gb_interface_find(struct greybus_host_device *hd, +struct gb_interface *gb_interface_find(struct gb_host_device *hd, u8 interface_id) { struct gb_interface *intf; @@ -120,7 +120,7 @@ int gb_create_bundle_connection(struct gb_interface *intf, u8 class) * Returns a pointer to the new interfce or a null pointer if a * failure occurs due to memory exhaustion. */ -struct gb_interface *gb_interface_create(struct greybus_host_device *hd, +struct gb_interface *gb_interface_create(struct gb_host_device *hd, u8 interface_id) { struct gb_module *module; @@ -199,7 +199,7 @@ void gb_interface_remove(struct gb_interface *intf) put_device(&module->dev); } -void gb_interfaces_remove(struct greybus_host_device *hd) +void gb_interfaces_remove(struct gb_host_device *hd) { struct gb_interface *intf, *temp; diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h index 9bce94f..248c991 100644 --- a/drivers/staging/greybus/interface.h +++ b/drivers/staging/greybus/interface.h @@ -16,7 +16,7 @@ struct gb_interface { struct gb_control *control; struct list_head bundles; - struct list_head links; /* greybus_host_device->interfaces */ + struct list_head links; /* gb_host_device->interfaces */ struct list_head manifest_descs; u8 interface_id; /* Physical location within the Endo */ u8 device_id; /* Device id allocated for the interface block by the SVC */ @@ -35,7 +35,7 @@ struct gb_interface { u32 ara_prod_id; struct gb_module *module; - struct greybus_host_device *hd; + struct gb_host_device *hd; /* The interface needs to boot over unipro */ bool boot_over_unipro; @@ -55,15 +55,15 @@ static inline void *gb_interface_get_drvdata(struct gb_interface *intf) /* Greybus "private" definitions */ -struct gb_interface *gb_interface_find(struct greybus_host_device *hd, +struct gb_interface *gb_interface_find(struct gb_host_device *hd, u8 interface_id); -struct gb_interface *gb_interface_create(struct greybus_host_device *hd, +struct gb_interface *gb_interface_create(struct gb_host_device *hd, u8 interface_id); void gb_interface_destroy(struct gb_interface *intf); int gb_interface_init(struct gb_interface *intf, u8 device_id); void gb_interface_remove(struct gb_interface *intf); -void gb_interfaces_remove(struct greybus_host_device *hd); +void gb_interfaces_remove(struct gb_host_device *hd); int gb_create_bundle_connection(struct gb_interface *intf, u8 class); #endif /* __INTERFACE_H */ diff --git a/drivers/staging/greybus/module.c b/drivers/staging/greybus/module.c index 43e8bab..e3d7a66 100644 --- a/drivers/staging/greybus/module.c +++ b/drivers/staging/greybus/module.c @@ -108,7 +108,7 @@ static int module_find(struct device *dev, void *data) * Search the list of modules in the system. If one is found, return it, with * the reference count incremented. */ -struct gb_module *gb_module_find(struct greybus_host_device *hd, u8 module_id) +struct gb_module *gb_module_find(struct gb_host_device *hd, u8 module_id) { struct device *dev; struct gb_module *module = NULL; diff --git a/drivers/staging/greybus/module.h b/drivers/staging/greybus/module.h index 3b3f421..2b36fe9 100644 --- a/drivers/staging/greybus/module.h +++ b/drivers/staging/greybus/module.h @@ -16,10 +16,10 @@ struct gb_module { }; #define to_gb_module(d) container_of(d, struct gb_module, dev) -struct greybus_host_device; +struct gb_host_device; /* Greybus "private" definitions */ -struct gb_module *gb_module_find(struct greybus_host_device *hd, u8 module_id); +struct gb_module *gb_module_find(struct gb_host_device *hd, u8 module_id); struct gb_module *gb_module_create(struct device *parent, u8 module_id); void gb_module_remove_all(struct gb_endo *endo); diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c index 3e29d21..1643880 100644 --- a/drivers/staging/greybus/operation.c +++ b/drivers/staging/greybus/operation.c @@ -210,7 +210,7 @@ static int gb_message_send(struct gb_message *message, gfp_t gfp) */ static void gb_message_cancel(struct gb_message *message) { - struct greybus_host_device *hd = message->operation->connection->hd; + struct gb_host_device *hd = message->operation->connection->hd; hd->driver->message_cancel(message); } @@ -269,7 +269,7 @@ static void gb_operation_work(struct work_struct *work) gb_operation_put(operation); } -static void gb_operation_message_init(struct greybus_host_device *hd, +static void gb_operation_message_init(struct gb_host_device *hd, struct gb_message *message, u16 operation_id, size_t payload_size, u8 type) { @@ -320,7 +320,7 @@ static void gb_operation_message_init(struct greybus_host_device *hd, * message payload / the message size */ static struct gb_message * -gb_operation_message_alloc(struct greybus_host_device *hd, u8 type, +gb_operation_message_alloc(struct gb_host_device *hd, u8 type, size_t payload_size, gfp_t gfp_flags) { struct gb_message *message; @@ -430,7 +430,7 @@ static u8 gb_operation_errno_map(int errno) bool gb_operation_response_alloc(struct gb_operation *operation, size_t response_size, gfp_t gfp) { - struct greybus_host_device *hd = operation->connection->hd; + struct gb_host_device *hd = operation->connection->hd; struct gb_operation_msg_hdr *request_header; struct gb_message *response; u8 type; @@ -482,7 +482,7 @@ gb_operation_create_common(struct gb_connection *connection, u8 type, size_t request_size, size_t response_size, unsigned long op_flags, gfp_t gfp_flags) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; struct gb_operation *operation; operation = kmem_cache_zalloc(gb_operation_cache, gfp_flags); @@ -548,7 +548,7 @@ EXPORT_SYMBOL_GPL(gb_operation_create); size_t gb_operation_get_payload_size_max(struct gb_connection *connection) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; return hd->buffer_size_max - sizeof(struct gb_operation_msg_hdr); } @@ -777,7 +777,7 @@ err_put: /* * This function is called when a message send request has completed. */ -void greybus_message_sent(struct greybus_host_device *hd, +void greybus_message_sent(struct gb_host_device *hd, struct gb_message *message, int status) { struct gb_operation *operation = message->operation; diff --git a/drivers/staging/greybus/operation.h b/drivers/staging/greybus/operation.h index 0f44ec8..c3f7ce7 100644 --- a/drivers/staging/greybus/operation.h +++ b/drivers/staging/greybus/operation.h @@ -150,7 +150,7 @@ gb_operation_request_send_sync(struct gb_operation *operation) void gb_operation_cancel(struct gb_operation *operation, int errno); void gb_operation_cancel_incoming(struct gb_operation *operation, int errno); -void greybus_message_sent(struct greybus_host_device *hd, +void greybus_message_sent(struct gb_host_device *hd, struct gb_message *message, int status); int gb_operation_sync_timeout(struct gb_connection *connection, int type, diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index e5cd897..c2633e2 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -42,7 +42,7 @@ struct svc_hotplug { * This is a temporary connection, used only at initial bootup. */ struct gb_connection * -gb_ap_svc_connection_create(struct greybus_host_device *hd) +gb_ap_svc_connection_create(struct gb_host_device *hd) { struct gb_connection *connection; @@ -61,7 +61,7 @@ gb_ap_svc_connection_create(struct greybus_host_device *hd) * 'partially' initialized one svc connection. */ static struct gb_interface * -gb_ap_interface_create(struct greybus_host_device *hd, +gb_ap_interface_create(struct gb_host_device *hd, struct gb_connection *connection, u8 interface_id) { struct gb_interface *intf; @@ -183,7 +183,7 @@ EXPORT_SYMBOL_GPL(gb_svc_dme_peer_set); */ static int gb_svc_read_and_clear_module_boot_status(struct gb_interface *intf) { - struct greybus_host_device *hd = intf->hd; + struct gb_host_device *hd = intf->hd; int ret; u32 value; @@ -338,7 +338,7 @@ static int gb_svc_version_request(struct gb_operation *op) static int gb_svc_hello(struct gb_operation *op) { struct gb_connection *connection = op->connection; - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; struct gb_svc_hello_request *hello_request; struct gb_interface *intf; u16 endo_id; @@ -381,7 +381,7 @@ static int gb_svc_hello(struct gb_operation *op) static void svc_intf_remove(struct gb_connection *connection, struct gb_interface *intf) { - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; struct gb_svc *svc = connection->private; u8 intf_id = intf->interface_id; u8 device_id; @@ -408,7 +408,7 @@ static void svc_process_hotplug(struct work_struct *work) struct gb_svc_intf_hotplug_request *hotplug = &svc_hotplug->data; struct gb_connection *connection = svc_hotplug->connection; struct gb_svc *svc = connection->private; - struct greybus_host_device *hd = connection->hd; + struct gb_host_device *hd = connection->hd; struct gb_interface *intf; u8 intf_id, device_id; int ret; @@ -552,7 +552,7 @@ static int gb_svc_intf_hot_unplug_recv(struct gb_operation *op) { struct gb_message *request = op->request; struct gb_svc_intf_hot_unplug_request *hot_unplug = request->payload; - struct greybus_host_device *hd = op->connection->hd; + struct gb_host_device *hd = op->connection->hd; struct gb_interface *intf; u8 intf_id; diff --git a/drivers/staging/greybus/svc.h b/drivers/staging/greybus/svc.h index 3357d31..d2f406f 100644 --- a/drivers/staging/greybus/svc.h +++ b/drivers/staging/greybus/svc.h @@ -25,6 +25,6 @@ int gb_svc_dme_peer_set(struct gb_svc *svc, u8 intf_id, u16 attr, u16 selector, int gb_svc_protocol_init(void); void gb_svc_protocol_exit(void); -struct gb_connection * -gb_ap_svc_connection_create(struct greybus_host_device *hd); +struct gb_connection *gb_ap_svc_connection_create(struct gb_host_device *hd); + #endif /* __SVC_H */ -- 2.7.4