mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 23:50:53 +07:00
66b15db69c
With module.h being implicitly everywhere via device.h, the absence of explicitly including something for EXPORT_SYMBOL went unnoticed. Since we are heading to fix things up and clean module.h from the device.h file, we need to explicitly include these files now. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
35 lines
733 B
C
35 lines
733 B
C
/**
|
|
* mpc5xxx_get_bus_frequency - Find the bus frequency for a device
|
|
* @node: device node
|
|
*
|
|
* Returns bus frequency (IPS on MPC512x, IPB on MPC52xx),
|
|
* or 0 if the bus frequency cannot be found.
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/of_platform.h>
|
|
#include <linux/export.h>
|
|
|
|
unsigned int
|
|
mpc5xxx_get_bus_frequency(struct device_node *node)
|
|
{
|
|
struct device_node *np;
|
|
const unsigned int *p_bus_freq = NULL;
|
|
|
|
of_node_get(node);
|
|
while (node) {
|
|
p_bus_freq = of_get_property(node, "bus-frequency", NULL);
|
|
if (p_bus_freq)
|
|
break;
|
|
|
|
np = of_get_parent(node);
|
|
of_node_put(node);
|
|
node = np;
|
|
}
|
|
if (node)
|
|
of_node_put(node);
|
|
|
|
return p_bus_freq ? *p_bus_freq : 0;
|
|
}
|
|
EXPORT_SYMBOL(mpc5xxx_get_bus_frequency);
|