sdcard: Provide type "SD" for virtio sdcard. 54/19754/3
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 17 Apr 2014 08:40:59 +0000 (17:40 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 17 Apr 2014 09:02:12 +0000 (18:02 +0900)
Change-Id: Idba9d8a748245e3ff1f24e6f5e3843dfd26da76f
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
drivers/virtio/virtio.c

index ee59b74768d9555e27802e0256a9d448f599f48d..2037e82fa58ddee77f4d376f21572a35ad0457a8 100644 (file)
@@ -47,12 +47,29 @@ static ssize_t features_show(struct device *_d,
        len += sprintf(buf+len, "\n");
        return len;
 }
+#ifdef CONFIG_MARU // for virtio sdcard...
+#include "linux/virtio_ids.h"
+static ssize_t type_show(struct device *_d,
+                               struct device_attribute *attr, char *buf)
+{
+       struct virtio_device *dev = container_of(_d, struct virtio_device, dev);
+
+    if (dev->id.device == VIRTIO_ID_BLOCK) {
+        //FIXME
+        return sprintf(buf, "SD\n");
+    }
+    return sprintf(buf, "0\n");
+}
+#endif
 static struct device_attribute virtio_dev_attrs[] = {
        __ATTR_RO(device),
        __ATTR_RO(vendor),
        __ATTR_RO(status),
        __ATTR_RO(modalias),
        __ATTR_RO(features),
+#ifdef CONFIG_MARU
+       __ATTR_RO(type),
+#endif
        __ATTR_NULL
 };