}
 
 /**
- * devm_gpiochip_add_data() - Resource managed gpiochip_add_data()
+ * devm_gpiochip_add_data_with_key() - Resource managed gpiochip_add_data_with_key()
  * @dev: pointer to the device that gpio_chip belongs to.
  * @gc: the GPIO chip to register
  * @data: driver-private data associated with this chip
+ * @lock_key: lockdep class for IRQ lock
+ * @request_key: lockdep class for IRQ request
  *
  * Context: potentially before irqs will work
  *
  * gc->base is invalid or already associated with a different chip.
  * Otherwise it returns zero as a success code.
  */
-int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *gc,
-                          void *data)
+int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc, void *data,
+                                   struct lock_class_key *lock_key,
+                                   struct lock_class_key *request_key)
 {
        struct gpio_chip **ptr;
        int ret;
        if (!ptr)
                return -ENOMEM;
 
-       ret = gpiochip_add_data(gc, data);
+       ret = gpiochip_add_data_with_key(gc, data, lock_key, request_key);
        if (ret < 0) {
                devres_free(ptr);
                return ret;
 
        return 0;
 }
-EXPORT_SYMBOL_GPL(devm_gpiochip_add_data);
+EXPORT_SYMBOL_GPL(devm_gpiochip_add_data_with_key);
 
                gpiochip_add_data_with_key(gc, data, &lock_key, \
                                           &request_key);         \
        })
+#define devm_gpiochip_add_data(dev, gc, data) ({ \
+               static struct lock_class_key lock_key;  \
+               static struct lock_class_key request_key;         \
+               devm_gpiochip_add_data_with_key(dev, gc, data, &lock_key, \
+                                          &request_key);         \
+       })
 #else
 #define gpiochip_add_data(gc, data) gpiochip_add_data_with_key(gc, data, NULL, NULL)
+#define devm_gpiochip_add_data(dev, gc, data) \
+       devm_gpiochip_add_data_with_key(dev, gc, data, NULL, NULL)
 #endif /* CONFIG_LOCKDEP */
 
 static inline int gpiochip_add(struct gpio_chip *gc)
        return gpiochip_add_data(gc, NULL);
 }
 extern void gpiochip_remove(struct gpio_chip *gc);
-extern int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *gc,
-                                 void *data);
+extern int devm_gpiochip_add_data_with_key(struct device *dev, struct gpio_chip *gc, void *data,
+                                          struct lock_class_key *lock_key,
+                                          struct lock_class_key *request_key);
 
 extern struct gpio_chip *gpiochip_find(void *data,
                              int (*match)(struct gpio_chip *gc, void *data));