Commit e96b1b06 authored by Steven J. Hill's avatar Steven J. Hill Committed by Ralf Baechle

MIPS: Octeon: Clean up platform code.

Remove unused headers and fix warnings from checkpatch.
Signed-off-by: default avatarSteven J. Hill <Steven.Hill@cavium.com>
Acked-by: default avatarDavid Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15407/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 97b70298
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
* Copyright (C) 2008 Wind River Systems * Copyright (C) 2008 Wind River Systems
*/ */
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/of_fdt.h> #include <linux/of_fdt.h>
...@@ -440,7 +438,7 @@ static int __init octeon_rng_device_init(void) ...@@ -440,7 +438,7 @@ static int __init octeon_rng_device_init(void)
} }
device_initcall(octeon_rng_device_init); device_initcall(octeon_rng_device_init);
static struct of_device_id __initdata octeon_ids[] = { const struct of_device_id octeon_ids[] __initconst = {
{ .compatible = "simple-bus", }, { .compatible = "simple-bus", },
{ .compatible = "cavium,octeon-6335-uctl", }, { .compatible = "cavium,octeon-6335-uctl", },
{ .compatible = "cavium,octeon-5750-usbn", }, { .compatible = "cavium,octeon-5750-usbn", },
...@@ -480,6 +478,7 @@ static void __init octeon_fdt_set_phy(int eth, int phy_addr) ...@@ -480,6 +478,7 @@ static void __init octeon_fdt_set_phy(int eth, int phy_addr)
alt_phy_handle = fdt_getprop(initial_boot_params, eth, "cavium,alt-phy-handle", NULL); alt_phy_handle = fdt_getprop(initial_boot_params, eth, "cavium,alt-phy-handle", NULL);
if (alt_phy_handle) { if (alt_phy_handle) {
u32 alt_phandle = be32_to_cpup(alt_phy_handle); u32 alt_phandle = be32_to_cpup(alt_phy_handle);
alt_phy = fdt_node_offset_by_phandle(initial_boot_params, alt_phandle); alt_phy = fdt_node_offset_by_phandle(initial_boot_params, alt_phandle);
} else { } else {
alt_phy = -1; alt_phy = -1;
...@@ -578,6 +577,7 @@ static void __init octeon_fdt_rm_ethernet(int node) ...@@ -578,6 +577,7 @@ static void __init octeon_fdt_rm_ethernet(int node)
if (phy_handle) { if (phy_handle) {
u32 ph = be32_to_cpup(phy_handle); u32 ph = be32_to_cpup(phy_handle);
int p = fdt_node_offset_by_phandle(initial_boot_params, ph); int p = fdt_node_offset_by_phandle(initial_boot_params, ph);
if (p >= 0) if (p >= 0)
fdt_nop_node(initial_boot_params, p); fdt_nop_node(initial_boot_params, p);
} }
...@@ -727,6 +727,7 @@ int __init octeon_prune_device_tree(void) ...@@ -727,6 +727,7 @@ int __init octeon_prune_device_tree(void)
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
int mgmt; int mgmt;
snprintf(name_buffer, sizeof(name_buffer), snprintf(name_buffer, sizeof(name_buffer),
"mix%d", i); "mix%d", i);
alias_prop = fdt_getprop(initial_boot_params, aliases, alias_prop = fdt_getprop(initial_boot_params, aliases,
...@@ -742,6 +743,7 @@ int __init octeon_prune_device_tree(void) ...@@ -742,6 +743,7 @@ int __init octeon_prune_device_tree(void)
name_buffer); name_buffer);
} else { } else {
int phy_addr = cvmx_helper_board_get_mii_address(CVMX_HELPER_BOARD_MGMT_IPD_PORT + i); int phy_addr = cvmx_helper_board_get_mii_address(CVMX_HELPER_BOARD_MGMT_IPD_PORT + i);
octeon_fdt_set_phy(mgmt, phy_addr); octeon_fdt_set_phy(mgmt, phy_addr);
} }
} }
...@@ -750,6 +752,7 @@ int __init octeon_prune_device_tree(void) ...@@ -750,6 +752,7 @@ int __init octeon_prune_device_tree(void)
pip_path = fdt_getprop(initial_boot_params, aliases, "pip", NULL); pip_path = fdt_getprop(initial_boot_params, aliases, "pip", NULL);
if (pip_path) { if (pip_path) {
int pip = fdt_path_offset(initial_boot_params, pip_path); int pip = fdt_path_offset(initial_boot_params, pip_path);
if (pip >= 0) if (pip >= 0)
for (i = 0; i <= 4; i++) for (i = 0; i <= 4; i++)
octeon_fdt_pip_iface(pip, i); octeon_fdt_pip_iface(pip, i);
...@@ -766,6 +769,7 @@ int __init octeon_prune_device_tree(void) ...@@ -766,6 +769,7 @@ int __init octeon_prune_device_tree(void)
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
int i2c; int i2c;
snprintf(name_buffer, sizeof(name_buffer), snprintf(name_buffer, sizeof(name_buffer),
"twsi%d", i); "twsi%d", i);
alias_prop = fdt_getprop(initial_boot_params, aliases, alias_prop = fdt_getprop(initial_boot_params, aliases,
...@@ -796,11 +800,11 @@ int __init octeon_prune_device_tree(void) ...@@ -796,11 +800,11 @@ int __init octeon_prune_device_tree(void)
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
int i2c; int i2c;
snprintf(name_buffer, sizeof(name_buffer), snprintf(name_buffer, sizeof(name_buffer),
"smi%d", i); "smi%d", i);
alias_prop = fdt_getprop(initial_boot_params, aliases, alias_prop = fdt_getprop(initial_boot_params, aliases,
name_buffer, NULL); name_buffer, NULL);
if (alias_prop) { if (alias_prop) {
i2c = fdt_path_offset(initial_boot_params, alias_prop); i2c = fdt_path_offset(initial_boot_params, alias_prop);
if (i2c < 0) if (i2c < 0)
...@@ -823,6 +827,7 @@ int __init octeon_prune_device_tree(void) ...@@ -823,6 +827,7 @@ int __init octeon_prune_device_tree(void)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
int uart; int uart;
snprintf(name_buffer, sizeof(name_buffer), snprintf(name_buffer, sizeof(name_buffer),
"uart%d", i); "uart%d", i);
alias_prop = fdt_getprop(initial_boot_params, aliases, alias_prop = fdt_getprop(initial_boot_params, aliases,
...@@ -862,6 +867,7 @@ int __init octeon_prune_device_tree(void) ...@@ -862,6 +867,7 @@ int __init octeon_prune_device_tree(void)
int len; int len;
int cf = fdt_path_offset(initial_boot_params, alias_prop); int cf = fdt_path_offset(initial_boot_params, alias_prop);
base_ptr = 0; base_ptr = 0;
if (octeon_bootinfo->major_version == 1 if (octeon_bootinfo->major_version == 1
&& octeon_bootinfo->minor_version >= 1) { && octeon_bootinfo->minor_version >= 1) {
...@@ -911,6 +917,7 @@ int __init octeon_prune_device_tree(void) ...@@ -911,6 +917,7 @@ int __init octeon_prune_device_tree(void)
fdt_nop_property(initial_boot_params, cf, "cavium,dma-engine-handle"); fdt_nop_property(initial_boot_params, cf, "cavium,dma-engine-handle");
if (!is_16bit) { if (!is_16bit) {
__be32 width = cpu_to_be32(8); __be32 width = cpu_to_be32(8);
fdt_setprop_inplace(initial_boot_params, cf, fdt_setprop_inplace(initial_boot_params, cf,
"cavium,bus-width", &width, sizeof(width)); "cavium,bus-width", &width, sizeof(width));
} }
...@@ -1036,6 +1043,7 @@ int __init octeon_prune_device_tree(void) ...@@ -1036,6 +1043,7 @@ int __init octeon_prune_device_tree(void)
} else { } else {
__be32 new_f[1]; __be32 new_f[1];
enum cvmx_helper_board_usb_clock_types c; enum cvmx_helper_board_usb_clock_types c;
c = __cvmx_helper_board_usb_get_clock_type(); c = __cvmx_helper_board_usb_get_clock_type();
switch (c) { switch (c) {
case USB_CLOCK_TYPE_REF_48: case USB_CLOCK_TYPE_REF_48:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment