As far as I understood, there's no easy and correct way to read files from kernel space.
Since in my project this file read is provisional only for test purposes, it's okay to read file the "ugly" way, described in the article in the question. If the release version of the kernel module uses such file interactions, that's unacceptable.