#include <linux/io.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
struct rmem { … };
static int rmem_read(void *context, unsigned int offset,
void *val, size_t bytes)
{ … }
static int rmem_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id rmem_match[] = …;
MODULE_DEVICE_TABLE(of, rmem_match);
static struct platform_driver rmem_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;