Skip to contentSkip to conversation

usb: Set category and description of the MTP device

PATCH Applied Thomas Huth 3 participants 3 messages Jan 20, 2017 – Jan 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: Set category and description of the MTP device

It's a storage device, so let's classify it accordingly. And while we're at it, also add a short description for people who do not know what MTP means.

---
 hw/usb/dev-mtp.c | 2 ++
 1 file changed, 2 insertions(+)
hw/usb/dev-mtp.c +2 -0
index 9cb0f50..bb73809 100644
@@ -1580,6 +1580,8 @@ static void usb_mtp_class_initfn(ObjectClass *klass, void *data)
     uc->handle_reset   = usb_mtp_handle_reset;
     uc->handle_control = usb_mtp_handle_control;
     uc->handle_data    = usb_mtp_handle_data;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+    dc->desc = "USB Media Transfer Protocol device";
     dc->fw_name = "mtp";
     dc->vmsd = &vmstate_usb_mtp;
     dc->props = mtp_properties;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Thomas Huth

It's a storage device, so let's classify it accordingly. And while we're at it, also add a short description for people who do not know what MTP means.

---
 hw/usb/dev-mtp.c | 2 ++
 1 file changed, 2 insertions(+)
hw/usb/dev-mtp.c +0 -0
index 9cb0f50..bb73809 100644

hw/usb/dev-mtp.c static void usb_mtp_class_initfn(ObjectClass *klass, void *data) · line 1587

Quoted 8 lines
hw/usb/dev-mtp.c +2 -0
@@ -1580,6 +1580,8 @@ static void usb_mtp_class_initfn(ObjectClass *klass, void *data)
     uc->handle_reset   = usb_mtp_handle_reset;
     uc->handle_control = usb_mtp_handle_control;
     uc->handle_data    = usb_mtp_handle_data;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+    dc->desc = "USB Media Transfer Protocol device";
     dc->fw_name = "mtp";
     dc->vmsd = &vmstate_usb_mtp;
     dc->props = mtp_properties;