]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - platform-intel.c
util: Introduce md_get_array_info()
[thirdparty/mdadm.git] / platform-intel.c
index 7ad88315025a1f1acc428773769433593e00f282..9867697b1296f7e9fbfaf62d8737437e748412d7 100644 (file)
@@ -187,6 +187,16 @@ struct sys_dev *device_by_id(__u16 device_id)
        return NULL;
 }
 
+struct sys_dev *device_by_id_and_path(__u16 device_id, const char *path)
+{
+       struct sys_dev *iter;
+
+       for (iter = intel_devices; iter != NULL; iter = iter->next)
+               if ((iter->dev_id == device_id) && strstr(iter->path, path))
+                       return iter;
+       return NULL;
+}
+
 static int devpath_to_ll(const char *dev_path, const char *entry, unsigned long long *val)
 {
        char path[strlen(dev_path) + strlen(entry) + 2];