summaryrefslogtreecommitdiffstats
path: root/common/reset_source.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/reset_source.c')
-rw-r--r--common/reset_source.c45
1 files changed, 11 insertions, 34 deletions
diff --git a/common/reset_source.c b/common/reset_source.c
index 8fdf052157..f28be90dcb 100644
--- a/common/reset_source.c
+++ b/common/reset_source.c
@@ -1,15 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
/*
* (C) Copyright 2012 Juergen Beisert - <kernel@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#define pr_fmt(fmt) "reset-source: " fmt
@@ -34,7 +25,7 @@ static const char * const reset_src_names[] = {
static enum reset_src_type reset_source;
static unsigned int reset_source_priority;
static int reset_source_instance;
-static struct device_d *reset_source_device;
+static struct device *reset_source_device;
enum reset_src_type reset_source_get(void)
{
@@ -42,11 +33,11 @@ enum reset_src_type reset_source_get(void)
}
EXPORT_SYMBOL(reset_source_get);
-const char *reset_source_name(void)
+const char *reset_source_to_string(enum reset_src_type st)
{
- return reset_src_names[reset_source];
+ return reset_src_names[st];
}
-EXPORT_SYMBOL(reset_source_name);
+EXPORT_SYMBOL(reset_source_to_string);
int reset_source_get_instance(void)
{
@@ -54,13 +45,13 @@ int reset_source_get_instance(void)
}
EXPORT_SYMBOL(reset_source_get_instance);
-struct device_d *reset_source_get_device(void)
+struct device *reset_source_get_device(void)
{
return reset_source_device;
}
EXPORT_SYMBOL(reset_source_get_device);
-static void __reset_source_set(struct device_d *dev,
+static void __reset_source_set(struct device *dev,
enum reset_src_type st,
unsigned int priority, int instance)
{
@@ -83,9 +74,11 @@ void reset_source_set_prinst(enum reset_src_type st,
}
EXPORT_SYMBOL(reset_source_set_prinst);
-void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
+void reset_source_set_device(struct device *dev, enum reset_src_type st)
{
- int priority = of_get_reset_source_priority(dev->device_node);
+ unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
+
+ of_property_read_u32(dev->of_node, "reset-source-priority", &priority);
__reset_source_set(dev, st, priority, -1);
}
@@ -101,19 +94,3 @@ static int reset_source_init(void)
return 0;
}
coredevice_initcall(reset_source_init);
-
-/**
- * of_get_reset_source_priority() - get the desired reset source priority from
- * device tree
- * @node: The device_node to read the property from
- *
- * return: The priority
- */
-unsigned int of_get_reset_source_priority(struct device_node *node)
-{
- unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
-
- of_property_read_u32(node, "reset-source-priority", &priority);
-
- return priority;
-}