You have just learned how to use the debugfs_create_u32() helper API to set up a debugfs file to read/write an unsigned 32-bit integer global. The fact is, the debugfs layer provides a bunch of similar "helper" APIs to implicitly read/write on numeric (integer) global variables within your module.
The helper routines for creating debugfs entries that can read/write different bit size unsigned integer (8-, 16-, 32-, and 64-bit) globals follow. The last parameter is the key one – the address of the global integer within the kernel/module:
// include/linux/debugfs.h
struct dentry *debugfs_create_u8(const char *name, umode_t mode,
struct dentry *parent, u8 *value);
struct dentry *debugfs_create_u16(const char *name, umode_t mode,
struct dentry *parent, u16 *value);
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
struct dentry *parent, u32 *value);
struct dentry...