From: Greg Kroah-Hartman Date: Fri, 19 Dec 2014 22:56:35 +0000 (-0800) Subject: greybus: interface: we really are creating/destroying interfaces not modules. X-Git-Tag: v5.15~12752^2~378^2~21^2~1751 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13e6aacf60ad6791268238b989a081edfe47e7d2;p=platform%2Fkernel%2Flinux-starfive.git greybus: interface: we really are creating/destroying interfaces not modules. rename gb_add_module -> gb_add_interface rename gb_remove_modules -> gb_remove_interfaces rename gb_remove_module -> gb_remove_interface And move the function prototypes to interface.h, where they belong. Reviewed-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index f9c63e4..e69566b 100644 --- a/drivers/staging/greybus/ap.c +++ b/drivers/staging/greybus/ap.c @@ -175,8 +175,8 @@ static void svc_hotplug(struct svc_function_hotplug *hotplug, return; } dev_dbg(hd->parent, "module id %d added\n", module_id); - gb_add_module(hd, module_id, hotplug->data, - payload_length - 0x02); + gb_add_interface(hd, module_id, hotplug->data, + payload_length - 0x02); break; case SVC_HOTUNPLUG_EVENT: @@ -189,7 +189,7 @@ static void svc_hotplug(struct svc_function_hotplug *hotplug, return; } dev_dbg(hd->parent, "module id %d removed\n", module_id); - gb_remove_module(hd, module_id); + gb_remove_interface(hd, module_id); break; default: diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 96410cb..3e00055 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -195,7 +195,7 @@ void greybus_remove_hd(struct greybus_host_device *hd) { /* Tear down all modules that happen to be associated with this host * controller */ - gb_remove_modules(hd); + gb_remove_interfaces(hd); kref_put_mutex(&hd->kref, free_hd, &hd_mutex); } EXPORT_SYMBOL_GPL(greybus_remove_hd); diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 4db5956..7071892 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -154,13 +154,6 @@ void greybus_deregister(struct greybus_driver *driver); int greybus_disabled(void); -/* Internal functions to gb module, move to internal .h file eventually. */ - -void gb_add_module(struct greybus_host_device *hd, u8 module_id, - u8 *data, int size); -void gb_remove_module(struct greybus_host_device *hd, u8 module_id); -void gb_remove_modules(struct greybus_host_device *hd); - int greybus_svc_in(struct greybus_host_device *hd, u8 *data, int length); int gb_ap_init(void); void gb_ap_exit(void); diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c index d840ae6..67b14df 100644 --- a/drivers/staging/greybus/interface.c +++ b/drivers/staging/greybus/interface.c @@ -175,13 +175,13 @@ static void gb_interface_destroy(struct gb_interface *intf) } /** - * gb_add_module + * gb_add_interface * * Pass in a buffer that _should_ contain a Greybus module manifest * and register a greybus device structure with the kernel core. */ -void gb_add_module(struct greybus_host_device *hd, u8 module_id, - u8 *data, int size) +void gb_add_interface(struct greybus_host_device *hd, u8 module_id, + u8 *data, int size) { struct gb_interface *intf; @@ -197,7 +197,7 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id, */ if (!gb_manifest_parse(intf, data, size)) { dev_err(hd->parent, "manifest error\n"); - goto err_module; + goto err_parse; } /* @@ -211,11 +211,11 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id, return; -err_module: +err_parse: gb_interface_destroy(intf); } -void gb_remove_module(struct greybus_host_device *hd, u8 module_id) +void gb_remove_interface(struct greybus_host_device *hd, u8 module_id) { struct gb_interface *intf = gb_interface_find(hd, module_id); @@ -225,7 +225,7 @@ void gb_remove_module(struct greybus_host_device *hd, u8 module_id) dev_err(hd->parent, "interface id %d not found\n", module_id); } -void gb_remove_modules(struct greybus_host_device *hd) +void gb_remove_interfaces(struct greybus_host_device *hd) { struct gb_interface *intf, *temp; diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h index 75f8135..70dad49e 100644 --- a/drivers/staging/greybus/interface.h +++ b/drivers/staging/greybus/interface.h @@ -49,4 +49,10 @@ const struct greybus_interface_id * struct gb_interface *gb_interface_find(struct greybus_host_device *hd, u8 module_id); +void gb_add_interface(struct greybus_host_device *hd, u8 module_id, + u8 *data, int size); +void gb_remove_interface(struct greybus_host_device *hd, u8 module_id); +void gb_remove_interfaces(struct greybus_host_device *hd); + + #endif /* __INTERFACE_H */