Skip to content

Commit

Permalink
Merge tag 'orion_cleanup_for_3.8' of git://git.infradead.org/users/jc…
Browse files Browse the repository at this point in the history
…ooper/linux into next/cleanup

From Jason Cooper:
orion cleanup for v3.8

 - remove unused includes in kirkwood
 - fix sparse warnings in kirkwood
 - checkpatch cleanup in kirkwood
 - use common code in pcie on kirkwood

* tag 'orion_cleanup_for_3.8' of git://git.infradead.org/users/jcooper/linux:
  ARM: Kirkwood: Use hw_pci.ops instead of hw_pci.scan
  ARM: Kirkwood: checkpatch cleanups
  ARM: Kirkwood: Fix sparse warnings.
  ARM: Kirkwood: Remove unused includes
  ARM: kirkwood: cleanup lsxl board includes
  • Loading branch information
Olof Johansson committed Nov 26, 2012
2 parents 0f9cb21 + 4a9329a commit d98eb5c
Show file tree
Hide file tree
Showing 23 changed files with 39 additions and 124 deletions.
13 changes: 0 additions & 13 deletions arch/arm/mach-kirkwood/board-dockstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,8 @@

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/ata_platform.h>
#include <linux/mv643xx_eth.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <mach/kirkwood.h>
#include <mach/bridge-regs.h>
#include <linux/platform_data/mmc-mvsdio.h>
#include "common.h"
#include "mpp.h"

Expand Down
15 changes: 0 additions & 15 deletions arch/arm/mach-kirkwood/board-dreamplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,8 @@

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/ata_platform.h>
#include <linux/mv643xx_eth.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/gpio.h>
#include <linux/mtd/physmap.h>
#include <linux/spi/flash.h>
#include <linux/spi/spi.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <mach/kirkwood.h>
#include <mach/bridge-regs.h>
#include <linux/platform_data/mmc-mvsdio.h>
#include "common.h"
#include "mpp.h"
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-kirkwood/board-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = {
{ }
};

struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
static struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL),
OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0",
NULL),
Expand Down Expand Up @@ -98,7 +98,7 @@ static void __init kirkwood_dt_init(void)
kirkwood_auxdata_lookup, NULL);
}

static const char *kirkwood_dt_board_compat[] = {
static const char * const kirkwood_dt_board_compat[] = {
"globalscale,dreamplug",
"dlink,dns-320",
"dlink,dns-325",
Expand Down
13 changes: 0 additions & 13 deletions arch/arm/mach-kirkwood/board-goflexnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,8 @@

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/ata_platform.h>
#include <linux/mv643xx_eth.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/gpio.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <mach/kirkwood.h>
#include <mach/bridge-regs.h>
#include <linux/platform_data/mmc-mvsdio.h>
#include "common.h"
#include "mpp.h"

Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-kirkwood/board-ib62x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mtd/partitions.h>
#include <linux/ata_platform.h>
#include <linux/mv643xx_eth.h>
#include <linux/gpio.h>
#include <linux/input.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/kirkwood.h>
#include "common.h"
#include "mpp.h"

Expand Down
8 changes: 0 additions & 8 deletions arch/arm/mach-kirkwood/board-iconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_fdt.h>
#include <linux/of_irq.h>
#include <linux/of_platform.h>
#include <linux/mv643xx_eth.h>
#include <linux/gpio.h>
#include <asm/mach/arch.h>
#include <mach/kirkwood.h>
#include "common.h"
#include "mpp.h"

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-kirkwood/board-iomega_ix2_200.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mv643xx_eth.h>
#include <linux/ethtool.h>
#include <mach/kirkwood.h>
#include "common.h"
#include "mpp.h"

Expand Down
8 changes: 0 additions & 8 deletions arch/arm/mach-kirkwood/board-lsxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mtd/partitions.h>
#include <linux/ata_platform.h>
#include <linux/spi/flash.h>
#include <linux/spi/spi.h>
#include <linux/mv643xx_eth.h>
#include <linux/gpio.h>
#include <linux/gpio-fan.h>
#include <linux/input.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/kirkwood.h>
#include "common.h"
#include "mpp.h"

Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-kirkwood/board-ts219.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mv643xx_eth.h>
#include <linux/ata_platform.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <mach/kirkwood.h>
Expand Down
11 changes: 5 additions & 6 deletions arch/arm/mach-kirkwood/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include <linux/clk-provider.h>
#include <linux/spinlock.h>
#include <linux/mv643xx_i2c.h>
#include <linux/timex.h>
#include <linux/kexec.h>
#include <net/dsa.h>
#include <asm/page.h>
#include <asm/timex.h>
#include <asm/kexec.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
#include <mach/kirkwood.h>
Expand Down Expand Up @@ -425,7 +425,7 @@ void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
/*****************************************************************************
* SPI
****************************************************************************/
void __init kirkwood_spi_init()
void __init kirkwood_spi_init(void)
{
orion_spi_init(SPI_PHYS_BASE);
}
Expand Down Expand Up @@ -646,8 +646,7 @@ void __init kirkwood_l2_init(void)

void __init kirkwood_init(void)
{
printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
kirkwood_id(), kirkwood_tclk);
pr_info("Kirkwood: %s, TCLK=%d.\n", kirkwood_id(), kirkwood_tclk);

/*
* Disable propagation of mbus errors to the CPU local bus,
Expand All @@ -671,7 +670,7 @@ void __init kirkwood_init(void)
kirkwood_xor1_init();
kirkwood_crypto_init();

#ifdef CONFIG_KEXEC
#ifdef CONFIG_KEXEC
kexec_reinit = kirkwood_enable_pcie;
#endif
}
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-kirkwood/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ void kirkwood_i2c_init(void);
void kirkwood_uart0_init(void);
void kirkwood_uart1_init(void);
void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts, int (*dev_ready)(struct mtd_info *));
void kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
int (*dev_ready)(struct mtd_info *));
void kirkwood_audio_init(void);
void kirkwood_restart(char, const char *);
void kirkwood_clk_init(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-kirkwood/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static int kirkwood_init_cpuidle(void)

cpuidle_register_driver(&kirkwood_idle_driver);
if (cpuidle_register_device(device)) {
printk(KERN_ERR "kirkwood_init_cpuidle: Failed registering\n");
pr_err("kirkwood_init_cpuidle: Failed registering\n");
return -EIO;
}
return 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-kirkwood/dockstar-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void __init dockstar_init(void)

if (gpio_request(29, "USB Power Enable") != 0 ||
gpio_direction_output(29, 1) != 0)
printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
pr_err("can't set up GPIO 29 (USB Power Enable)\n");
kirkwood_ehci_init();

kirkwood_ge00_init(&dockstar_ge00_data);
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-kirkwood/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <mach/bridge-regs.h>
#include <plat/orion-gpio.h>
#include <plat/irq.h>
#include "common.h"

static int __initdata gpio0_irqs[4] = {
IRQ_KIRKWOOD_GPIO_LOW_0_7,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-kirkwood/lacie_v2-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <mach/irqs.h>
#include <plat/time.h>
#include "common.h"
#include "lacie_v2-common.h"

/*****************************************************************************
* 512KB SPI Flash on Boot Device (MACRONIX MX25L4005)
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-kirkwood/mpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ static unsigned int __init kirkwood_variant(void)
if (dev == MV88F6180_DEV_ID)
return MPP_F6180_MASK;

printk(KERN_ERR "MPP setup: unknown kirkwood variant "
"(dev %#x rev %#x)\n", dev, rev);
pr_err("MPP setup: unknown kirkwood variant (dev %#x rev %#x)\n",
dev, rev);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-kirkwood/netspace_v2-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static struct platform_device netspace_v2_gpio_buttons = {
.name = "gpio-keys",
.id = -1,
.dev = {
.platform_data = &netspace_v2_button_data,
.platform_data = &netspace_v2_button_data,
},
};

Expand Down Expand Up @@ -211,7 +211,7 @@ static unsigned int netspace_v2_mpp_config[] __initdata = {
MPP29_GPIO, /* Blue led (slow register) */
MPP30_GPIO, /* Blue led (command register) */
MPP31_GPIO, /* Board power off */
MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */
MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */
MPP33_GPO, /* Fan speed (bit 2) */
0
};
Expand Down
14 changes: 5 additions & 9 deletions arch/arm/mach-kirkwood/openrd-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,12 @@ static int __init uart1_mpp_config(void)
kirkwood_mpp_conf(openrd_uart1_mpp_config);

if (gpio_request(34, "SD_UART1_SEL")) {
printk(KERN_ERR "GPIO request failed for SD/UART1 selection"
", gpio: 34\n");
pr_err("GPIO request 34 failed for SD/UART1 selection\n");
return -EIO;
}

if (gpio_request(28, "RS232_RS485_SEL")) {
printk(KERN_ERR "GPIO request failed for RS232/RS485 selection"
", gpio# 28\n");
pr_err("GPIO request 28 failed for RS232/RS485 selection\n");
gpio_free(34);
return -EIO;
}
Expand Down Expand Up @@ -185,15 +183,13 @@ static void __init openrd_init(void)

if (uart1 <= 0) {
if (uart1 < 0)
printk(KERN_ERR "Invalid kernel parameter to select "
"UART1. Defaulting to SD. ERROR CODE: %d\n",
uart1);
pr_err("Invalid kernel parameter to select UART1. Defaulting to SD. ERROR CODE: %d\n",
uart1);

/* Select SD
* Pin # 34: 0 => UART1, 1 => SD */
if (gpio_request(34, "SD_UART1_SEL")) {
printk(KERN_ERR "GPIO request failed for SD/UART1 "
"selection, gpio: 34\n");
pr_err("GPIO request 34 failed for SD/UART1 selection\n");
} else {

gpio_direction_output(34, 1);
Expand Down
31 changes: 8 additions & 23 deletions arch/arm/mach-kirkwood/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void kirkwood_enable_pcie_clk(const char *port)

clk = clk_get_sys("pcie", port);
if (IS_ERR(clk)) {
printk(KERN_ERR "PCIE clock %s missing\n", port);
pr_err("PCIE clock %s missing\n", port);
return;
}
clk_prepare_enable(clk);
Expand Down Expand Up @@ -168,7 +168,7 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
return 0;

index = pcie_port_map[nr];
printk(KERN_INFO "PCI: bus%d uses PCIe port %d\n", sys->busnr, index);
pr_info("PCI: bus%d uses PCIe port %d\n", sys->busnr, index);

pp = kzalloc(sizeof(*pp), GFP_KERNEL);
if (!pp)
Expand All @@ -186,7 +186,8 @@ static int __init kirkwood_pcie_setup(int nr, struct pci_sys_data *sys)
case 1:
kirkwood_enable_pcie_clk("1");
pcie1_ioresources_init(pp);
pci_ioremap_io(SZ_64K * sys->busnr, KIRKWOOD_PCIE1_IO_PHYS_BASE);
pci_ioremap_io(SZ_64K * sys->busnr,
KIRKWOOD_PCIE1_IO_PHYS_BASE);
break;
default:
panic("PCIe setup: invalid controller %d", index);
Expand Down Expand Up @@ -224,22 +225,6 @@ static void __devinit rc_pci_fixup(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);

static struct pci_bus __init *
kirkwood_pcie_scan_bus(int nr, struct pci_sys_data *sys)
{
struct pci_bus *bus;

if (nr < num_pcie_ports) {
bus = pci_scan_root_bus(NULL, sys->busnr, &pcie_ops, sys,
&sys->resources);
} else {
bus = NULL;
BUG();
}

return bus;
}

static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
u8 pin)
{
Expand All @@ -251,19 +236,19 @@ static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,

static struct hw_pci kirkwood_pci __initdata = {
.setup = kirkwood_pcie_setup,
.scan = kirkwood_pcie_scan_bus,
.map_irq = kirkwood_pcie_map_irq,
.ops = &pcie_ops,
};

static void __init add_pcie_port(int index, void __iomem *base)
{
printk(KERN_INFO "Kirkwood PCIe port %d: ", index);
pr_info("Kirkwood PCIe port %d: ", index);

if (orion_pcie_link_up(base)) {
printk(KERN_INFO "link up\n");
pr_info("link up\n");
pcie_port_map[num_pcie_ports++] = index;
} else
printk(KERN_INFO "link down, ignoring\n");
pr_info("link down, ignoring\n");
}

void __init kirkwood_pcie_init(unsigned int portmask)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-kirkwood/sheevaplug-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static void __init sheevaplug_init(void)

if (gpio_request(29, "USB Power Enable") != 0 ||
gpio_direction_output(29, 1) != 0)
printk(KERN_ERR "can't set up GPIO 29 (USB Power Enable)\n");
pr_err("can't set up GPIO 29 (USB Power Enable)\n");
kirkwood_ehci_init();

kirkwood_ge00_init(&sheevaplug_ge00_data);
Expand Down
Loading

0 comments on commit d98eb5c

Please sign in to comment.