Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / arch / powerpc / sysdev / qe_lib / ucc_fast.c
index 3223acb..1aecb07 100644 (file)
@@ -46,7 +46,7 @@ void ucc_fast_dump_regs(struct ucc_fast_private * uccf)
        printk(KERN_INFO "uccm  : addr=0x%p, val=0x%08x\n",
                  &uccf->uf_regs->uccm, in_be32(&uccf->uf_regs->uccm));
        printk(KERN_INFO "uccs  : addr=0x%p, val=0x%02x\n",
-                 &uccf->uf_regs->uccs, uccf->uf_regs->uccs);
+                 &uccf->uf_regs->uccs, in_8(&uccf->uf_regs->uccs));
        printk(KERN_INFO "urfb  : addr=0x%p, val=0x%08x\n",
                  &uccf->uf_regs->urfb, in_be32(&uccf->uf_regs->urfb));
        printk(KERN_INFO "urfs  : addr=0x%p, val=0x%04x\n",
@@ -68,7 +68,7 @@ void ucc_fast_dump_regs(struct ucc_fast_private * uccf)
        printk(KERN_INFO "urtry : addr=0x%p, val=0x%08x\n",
                  &uccf->uf_regs->urtry, in_be32(&uccf->uf_regs->urtry));
        printk(KERN_INFO "guemr : addr=0x%p, val=0x%02x\n",
-                 &uccf->uf_regs->guemr, uccf->uf_regs->guemr);
+                 &uccf->uf_regs->guemr, in_8(&uccf->uf_regs->guemr));
 }
 EXPORT_SYMBOL(ucc_fast_dump_regs);
 
@@ -96,7 +96,7 @@ EXPORT_SYMBOL(ucc_fast_transmit_on_demand);
 
 void ucc_fast_enable(struct ucc_fast_private * uccf, enum comm_dir mode)
 {
-       struct ucc_fast *uf_regs;
+       struct ucc_fast __iomem *uf_regs;
        u32 gumr;
 
        uf_regs = uccf->uf_regs;
@@ -117,7 +117,7 @@ EXPORT_SYMBOL(ucc_fast_enable);
 
 void ucc_fast_disable(struct ucc_fast_private * uccf, enum comm_dir mode)
 {
-       struct ucc_fast *uf_regs;
+       struct ucc_fast __iomem *uf_regs;
        u32 gumr;
 
        uf_regs = uccf->uf_regs;
@@ -139,7 +139,7 @@ EXPORT_SYMBOL(ucc_fast_disable);
 int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** uccf_ret)
 {
        struct ucc_fast_private *uccf;
-       struct ucc_fast *uf_regs;
+       struct ucc_fast __iomem *uf_regs;
        u32 gumr;
        int ret;
 
@@ -148,57 +148,57 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
 
        /* check if the UCC port number is in range. */
        if ((uf_info->ucc_num < 0) || (uf_info->ucc_num > UCC_MAX_NUM - 1)) {
-               printk(KERN_ERR "%s: illegal UCC number\n", __FUNCTION__);
+               printk(KERN_ERR "%s: illegal UCC number\n", __func__);
                return -EINVAL;
        }
 
        /* Check that 'max_rx_buf_length' is properly aligned (4). */
        if (uf_info->max_rx_buf_length & (UCC_FAST_MRBLR_ALIGNMENT - 1)) {
                printk(KERN_ERR "%s: max_rx_buf_length not aligned\n",
-                       __FUNCTION__);
+                       __func__);
                return -EINVAL;
        }
 
        /* Validate Virtual Fifo register values */
        if (uf_info->urfs < UCC_FAST_URFS_MIN_VAL) {
-               printk(KERN_ERR "%s: urfs is too small\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfs is too small\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->urfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: urfs is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfs is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->urfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: urfet is not aligned.\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfet is not aligned.\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->urfset & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: urfset is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: urfset is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->utfs & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: utfs is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: utfs is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->utfet & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: utfet is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: utfet is not aligned\n", __func__);
                return -EINVAL;
        }
 
        if (uf_info->utftt & (UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT - 1)) {
-               printk(KERN_ERR "%s: utftt is not aligned\n", __FUNCTION__);
+               printk(KERN_ERR "%s: utftt is not aligned\n", __func__);
                return -EINVAL;
        }
 
        uccf = kzalloc(sizeof(struct ucc_fast_private), GFP_KERNEL);
        if (!uccf) {
                printk(KERN_ERR "%s: Cannot allocate private data\n",
-                       __FUNCTION__);
+                       __func__);
                return -ENOMEM;
        }
 
@@ -207,7 +207,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        /* Set the PHY base address */
        uccf->uf_regs = ioremap(uf_info->regs, sizeof(struct ucc_fast));
        if (uccf->uf_regs == NULL) {
-               printk(KERN_ERR "%s: Cannot map UCC registers\n", __FUNCTION__);
+               printk(KERN_ERR "%s: Cannot map UCC registers\n", __func__);
                return -ENOMEM;
        }
 
@@ -216,10 +216,10 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        uccf->stopped_tx = 0;
        uccf->stopped_rx = 0;
        uf_regs = uccf->uf_regs;
-       uccf->p_ucce = (u32 *) & (uf_regs->ucce);
-       uccf->p_uccm = (u32 *) & (uf_regs->uccm);
+       uccf->p_ucce = &uf_regs->ucce;
+       uccf->p_uccm = &uf_regs->uccm;
 #ifdef CONFIG_UGETH_TX_ON_DEMAND
-       uccf->p_utodr = (u16 *) & (uf_regs->utodr);
+       uccf->p_utodr = &uf_regs->utodr;
 #endif
 #ifdef STATISTICS
        uccf->tx_frames = 0;
@@ -230,7 +230,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
        /* Set UCC to fast type */
        ret = ucc_set_type(uf_info->ucc_num, UCC_SPEED_TYPE_FAST);
        if (ret) {
-               printk(KERN_ERR "%s: cannot set UCC type\n", __FUNCTION__);
+               printk(KERN_ERR "%s: cannot set UCC type\n", __func__);
                ucc_fast_free(uccf);
                return ret;
        }
@@ -270,7 +270,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
            qe_muram_alloc(uf_info->utfs, UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
        if (IS_ERR_VALUE(uccf->ucc_fast_tx_virtual_fifo_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate MURAM for TX FIFO\n",
-                       __FUNCTION__);
+                       __func__);
                uccf->ucc_fast_tx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
                return -ENOMEM;
@@ -283,7 +283,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
                           UCC_FAST_VIRT_FIFO_REGS_ALIGNMENT);
        if (IS_ERR_VALUE(uccf->ucc_fast_rx_virtual_fifo_base_offset)) {
                printk(KERN_ERR "%s: cannot allocate MURAM for RX FIFO\n",
-                       __FUNCTION__);
+                       __func__);
                uccf->ucc_fast_rx_virtual_fifo_base_offset = 0;
                ucc_fast_free(uccf);
                return -ENOMEM;
@@ -314,7 +314,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
                    ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->rx_clock,
                                        COMM_DIR_RX)) {
                        printk(KERN_ERR "%s: illegal value for RX clock\n",
-                              __FUNCTION__);
+                              __func__);
                        ucc_fast_free(uccf);
                        return -EINVAL;
                }
@@ -323,7 +323,7 @@ int ucc_fast_init(struct ucc_fast_info * uf_info, struct ucc_fast_private ** ucc
                    ucc_set_qe_mux_rxtx(uf_info->ucc_num, uf_info->tx_clock,
                                        COMM_DIR_TX)) {
                        printk(KERN_ERR "%s: illegal value for TX clock\n",
-                              __FUNCTION__);
+                              __func__);
                        ucc_fast_free(uccf);
                        return -EINVAL;
                }