Pull ec into release branch
[pandora-kernel.git] / arch / powerpc / platforms / powermac / feature.c
index f8313bf..24cc50c 100644 (file)
@@ -486,10 +486,6 @@ static long heathrow_sound_enable(struct device_node *node, long param,
 
 static u32 save_fcr[6];
 static u32 save_mbcr;
-static u32 save_gpio_levels[2];
-static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
-static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
-static u32 save_unin_clock_ctl;
 static struct dbdma_regs save_dbdma[13];
 static struct dbdma_regs save_alt_dbdma[13];
 
@@ -814,6 +810,7 @@ core99_ata100_enable(struct device_node *node, long value)
        unsigned long flags;
        struct pci_dev *pdev = NULL;
        u8 pbus, pid;
+       int rc;
 
        if (uninorth_rev < 0x24)
                return -ENODEV;
@@ -832,7 +829,9 @@ core99_ata100_enable(struct device_node *node, long value)
                        pdev = pci_find_slot(pbus, pid);
                if (pdev == NULL)
                        return 0;
-               pci_enable_device(pdev);
+               rc = pci_enable_device(pdev);
+               if (rc)
+                       return rc;
                pci_set_master(pdev);
        }
        return 0;
@@ -1058,8 +1057,8 @@ core99_reset_cpu(struct device_node *node, long param, long value)
        if (np == NULL)
                return -ENODEV;
        for (np = np->child; np != NULL; np = np->sibling) {
-               u32 *num = (u32 *)get_property(np, "reg", NULL);
-               u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
+               const u32 *num = get_property(np, "reg", NULL);
+               const u32 *rst = get_property(np, "soft-reset", NULL);
                if (num == NULL || rst == NULL)
                        continue;
                if (param == *num) {
@@ -1087,7 +1086,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
 {
        struct macio_chip *macio;
        unsigned long flags;
-       char *prop;
+       const char *prop;
        int number;
        u32 reg;
 
@@ -1096,7 +1095,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
            macio->type != macio_intrepid)
                return -ENODEV;
 
-       prop = (char *)get_property(node, "AAPL,clock-id", NULL);
+       prop = get_property(node, "AAPL,clock-id", NULL);
        if (!prop)
                return -ENODEV;
        if (strncmp(prop, "usb0u048", 8) == 0)
@@ -1507,8 +1506,8 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
        if (np == NULL)
                return -ENODEV;
        for (np = np->child; np != NULL; np = np->sibling) {
-               u32 *num = (u32 *)get_property(np, "reg", NULL);
-               u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
+               const u32 *num = get_property(np, "reg", NULL);
+               const u32 *rst = get_property(np, "soft-reset", NULL);
                if (num == NULL || rst == NULL)
                        continue;
                if (param == *num) {
@@ -1548,6 +1547,10 @@ void g5_phy_disable_cpu1(void)
 
 
 #ifdef CONFIG_PM
+static u32 save_gpio_levels[2];
+static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
+static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
+static u32 save_unin_clock_ctl;
 
 static void keylargo_shutdown(struct macio_chip *macio, int sleep_mode)
 {
@@ -2408,7 +2411,7 @@ static int __init probe_motherboard(void)
         */
        dt = find_devices("device-tree");
        if (dt != NULL)
-               model = (const char *) get_property(dt, "model", NULL);
+               model = get_property(dt, "model", NULL);
        for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
            if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
                pmac_mb = pmac_mb_defs[i];
@@ -2536,7 +2539,7 @@ found:
  */
 static void __init probe_uninorth(void)
 {
-       u32 *addrp;
+       const u32 *addrp;
        phys_addr_t address;
        unsigned long actrl;
 
@@ -2555,7 +2558,7 @@ static void __init probe_uninorth(void)
        if (uninorth_node == NULL)
                return;
 
-       addrp = (u32 *)get_property(uninorth_node, "reg", NULL);
+       addrp = get_property(uninorth_node, "reg", NULL);
        if (addrp == NULL)
                return;
        address = of_translate_address(uninorth_node, addrp);
@@ -2596,7 +2599,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
        struct device_node*     node;
        int                     i;
        volatile u32 __iomem    *base;
-       u32                     *addrp, *revp;
+       const u32               *addrp, *revp;
        phys_addr_t             addr;
        u64                     size;
 
@@ -2639,7 +2642,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
                return;
        }
        if (type == macio_keylargo || type == macio_keylargo2) {
-               u32 *did = (u32 *)get_property(node, "device-id", NULL);
+               const u32 *did = get_property(node, "device-id", NULL);
                if (*did == 0x00000025)
                        type = macio_pangea;
                if (*did == 0x0000003e)
@@ -2652,7 +2655,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
        macio_chips[i].base     = base;
        macio_chips[i].flags    = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
        macio_chips[i].name     = macio_names[type];
-       revp = (u32 *)get_property(node, "revision-id", NULL);
+       revp = get_property(node, "revision-id", NULL);
        if (revp)
                macio_chips[i].rev = *revp;
        printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
@@ -2695,15 +2698,15 @@ static void __init
 initial_serial_shutdown(struct device_node *np)
 {
        int len;
-       struct slot_names_prop {
+       const struct slot_names_prop {
                int     count;
                char    name[1];
        } *slots;
-       char *conn;
+       const char *conn;
        int port_type = PMAC_SCC_ASYNC;
        int modem = 0;
 
-       slots = (struct slot_names_prop *)get_property(np, "slot-names", &len);
+       slots = get_property(np, "slot-names", &len);
        conn = get_property(np, "AAPL,connector", &len);
        if (conn && (strcmp(conn, "infrared") == 0))
                port_type = PMAC_SCC_IRDA;