]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/watchdog/kempld_wdt.c
net/mlx5e: Move mlx5e_rq struct declaration
[karo-tx-linux.git] / drivers / watchdog / kempld_wdt.c
index 73c46b3a09ab3ec80db0bfb7577fe289fc811b51..2f3b049ea3017c9c481e54b64610975830cdf25d 100644 (file)
@@ -140,12 +140,19 @@ static int kempld_wdt_set_stage_timeout(struct kempld_wdt_data *wdt_data,
                                        unsigned int timeout)
 {
        struct kempld_device_data *pld = wdt_data->pld;
-       u32 prescaler = kempld_prescaler[PRESCALER_21];
+       u32 prescaler;
        u64 stage_timeout64;
        u32 stage_timeout;
        u32 remainder;
        u8 stage_cfg;
 
+#if GCC_VERSION < 40400
+       /* work around a bug compiling do_div() */
+       prescaler = READ_ONCE(kempld_prescaler[PRESCALER_21]);
+#else
+       prescaler = kempld_prescaler[PRESCALER_21];
+#endif
+
        if (!stage)
                return -EINVAL;