diff options
-rw-r--r-- | drivers/staging/greybus/interface.c | 12 | ||||
-rw-r--r-- | drivers/staging/greybus/interface.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c index e21491b..9fe6764 100644 --- a/drivers/staging/greybus/interface.c +++ b/drivers/staging/greybus/interface.c @@ -95,6 +95,10 @@ static int gb_interface_read_dme(struct gb_interface *intf) { int ret; + /* DME attributes have already been read */ + if (intf->dme_read) + return 0; + ret = gb_interface_dme_attr_get(intf, DME_DDBL1_MANUFACTURERID, &intf->ddbl1_manufacturer_id); if (ret) @@ -111,7 +115,13 @@ static int gb_interface_read_dme(struct gb_interface *intf) intf->quirks |= GB_INTERFACE_QUIRK_NO_INIT_STATUS; } - return gb_interface_read_ara_dme(intf); + ret = gb_interface_read_ara_dme(intf); + if (ret) + return ret; + + intf->dme_read = true; + + return 0; } static int gb_interface_route_create(struct gb_interface *intf) diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h index bba1881..f52dfd0 100644 --- a/drivers/staging/greybus/interface.h +++ b/drivers/staging/greybus/interface.h @@ -56,6 +56,7 @@ struct gb_interface { bool active; bool enabled; bool mode_switch; + bool dme_read; struct work_struct mode_switch_work; struct completion mode_switch_completion; |