diff options
-rw-r--r-- | atasmart.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -2275,6 +2275,7 @@ static int disk_find_type(SkDisk *d, dev_t devnum) { struct udev *udev; struct udev_device *dev = NULL, *usb; int r = -1; + const char *a; assert(d); @@ -2288,6 +2289,27 @@ static int disk_find_type(SkDisk *d, dev_t devnum) { goto finish; } + if ((a = udev_device_get_property_value(dev, "ID_ATA_SMART_ACCESS"))) { + unsigned u; + + for (u = 0; u < _SK_DISK_TYPE_MAX; u++) { + const char *t; + + if (!(t = disk_type_to_prefix_string(u))) + continue; + + if (!strcmp(a, t)) { + d->type = u; + r = 0; + goto finish; + } + } + + d->type = SK_DISK_TYPE_NONE; + r = 0; + goto finish; + } + if ((usb = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device"))) { const char *product, *vendor; uint32_t pid, vid; |