chip->ngpio = config->ngpio;
        chip->names = config->names;
        chip->label = config->label ?: dev_name(config->parent);
-
-       /*
-        * If our regmap is fast_io we should probably set can_sleep to false.
-        * Right now, the regmap doesn't save this property, nor is there any
-        * access function for it.
-        * The only regmap type which uses fast_io is regmap-mmio. For now,
-        * assume a safe default of true here.
-        */
-       chip->can_sleep = true;
+       chip->can_sleep = regmap_might_sleep(config->regmap);
 
        chip->get = gpio_regmap_get;
        if (gpio->reg_set_base && gpio->reg_clr_base)