compat: fix uevent_suppress on 2.6.29 or older kernels
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 22 Apr 2010 13:39:34 +0000 (16:39 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 22 Apr 2010 13:54:51 +0000 (16:54 +0300)
Missing uevent_suppress is causing two uevents instead of one, which is
confusing udev and sometimes causing firmware load to fail due to race
condition, so let's add it.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
compat/compat_firmware_class.c

index ce937a3..54ee8b9 100644 (file)
@@ -432,6 +432,8 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
        dev_set_drvdata(f_dev, fw_priv);
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
        dev_set_uevent_suppress(f_dev, 1);
        dev_set_drvdata(f_dev, fw_priv);
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
        dev_set_uevent_suppress(f_dev, 1);
+#else
+       f_dev->uevent_suppress = 1;
 #endif
        retval = device_register(f_dev);
        if (retval) {
 #endif
        retval = device_register(f_dev);
        if (retval) {
@@ -479,9 +481,11 @@ static int fw_setup_device(struct firmware *fw, struct device **dev_p,
                goto error_unreg;
        }
 
                goto error_unreg;
        }
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
        if (uevent)
        if (uevent)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30))
                dev_set_uevent_suppress(f_dev, 0);
                dev_set_uevent_suppress(f_dev, 0);
+#else
+               f_dev->uevent_suppress = 0;
 #endif
        *dev_p = f_dev;
        goto out;
 #endif
        *dev_p = f_dev;
        goto out;