summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/bundle.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-07-01 12:13:58 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2015-07-01 16:38:42 -0700
commitc3add7883c70b625b99c37ca89e6ec8733037ce3 (patch)
treef5fe6f2f17ffdd6f482b6c8c5204ac69f37c7ab0 /drivers/staging/greybus/bundle.c
parent7e9017d482a2678ed32e7f60e6bfea10bab2dfa1 (diff)
downloadop-kernel-dev-c3add7883c70b625b99c37ca89e6ec8733037ce3.zip
op-kernel-dev-c3add7883c70b625b99c37ca89e6ec8733037ce3.tar.gz
greybus: interface: device_id belongs to the interface
While introducing bundles, the device_id also got moved to the bundle, whereas it identifies an interface block to the AP. Move it back to interface instead of bundle. Calls to gb_bundle(s)_init() are dropped as connections will be initialized while they are created now, as device_id will be valid. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/bundle.c')
-rw-r--r--drivers/staging/greybus/bundle.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
index e636230..c6694ae 100644
--- a/drivers/staging/greybus/bundle.c
+++ b/drivers/staging/greybus/bundle.c
@@ -13,15 +13,6 @@ static void gb_bundle_connections_exit(struct gb_bundle *bundle);
static int gb_bundle_connections_init(struct gb_bundle *bundle);
-static ssize_t device_id_show(struct device *dev, struct device_attribute *attr,
- char *buf)
-{
- struct gb_bundle *bundle = to_gb_bundle(dev);
-
- return sprintf(buf, "%d\n", bundle->device_id);
-}
-static DEVICE_ATTR_RO(device_id);
-
static ssize_t class_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
@@ -61,7 +52,6 @@ static DEVICE_ATTR_RW(state);
static struct attribute *bundle_attrs[] = {
- &dev_attr_device_id.attr,
&dev_attr_class.attr,
&dev_attr_state.attr,
NULL,
@@ -184,9 +174,6 @@ struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
bundle->class = class;
INIT_LIST_HEAD(&bundle->connections);
- /* Invalid device id to start with */
- bundle->device_id = GB_DEVICE_ID_BAD;
-
/* Build up the bundle device structures and register it with the
* driver core */
bundle->dev.parent = &intf->dev;
@@ -225,7 +212,7 @@ void gb_bundle_destroy(struct gb_bundle *bundle)
device_unregister(&bundle->dev);
}
-int gb_bundle_init(struct gb_bundle *bundle, u8 device_id)
+int gb_bundle_init(struct gb_bundle *bundle)
{
struct gb_interface *intf = bundle->intf;
int ret;
@@ -234,8 +221,6 @@ int gb_bundle_init(struct gb_bundle *bundle, u8 device_id)
if (intf->control && bundle->id == GB_CONTROL_BUNDLE_ID)
return 0;
- bundle->device_id = device_id;
-
ret = gb_bundle_connections_init(bundle);
if (ret) {
dev_err(intf->hd->parent, "interface bundle init error %d\n",
@@ -247,13 +232,13 @@ int gb_bundle_init(struct gb_bundle *bundle, u8 device_id)
return 0;
}
-int gb_bundles_init(struct gb_interface *intf, u8 device_id)
+int gb_bundles_init(struct gb_interface *intf)
{
struct gb_bundle *bundle;
int ret = 0;
list_for_each_entry(bundle, &intf->bundles, links) {
- ret = gb_bundle_init(bundle, device_id);
+ ret = gb_bundle_init(bundle);
if (ret) {
dev_err(intf->hd->parent,
"Failed to initialize bundle %hhu\n",
OpenPOWER on IntegriCloud