#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <linux/reset/sunxi.h>
#include <linux/spinlock.h>
#include "reset-simple.h"
static int sunxi_reset_init(struct device_node *np)
struct reset_simple_data *data;
data = kzalloc(sizeof(*data), GFP_KERNEL);
ret = of_address_to_resource(np, 0, &res);
size = resource_size(&res);
if (!request_mem_region(res.start, size, np->name)) {
data->membase = ioremap(res.start, size);
spin_lock_init(&data->lock);
data->rcdev.owner = THIS_MODULE;
data->rcdev.nr_resets = size * 8;
data->rcdev.ops = &reset_simple_ops;
data->rcdev.of_node = np;
return reset_controller_register(&data->rcdev);