Commit fbc63864 authored by Vincent Whitchurch's avatar Vincent Whitchurch Committed by Greg Kroah-Hartman

mic: Rename ioremap pointer to remap

Some architectures (like MIPS) implement ioremap as a macro, and this
leads to conflicts with the ioremap function pointer in various mic
structures.

 drivers/misc/mic/vop/vop_vringh.c:
   In function 'vop_virtio_init_post':
 drivers/misc/mic/vop/vop_vringh.c:86:13:
   error: macro "ioremap" passed 3 arguments, but takes just 2

Rename ioremap to remap to fix this.  Likewise for iounmap.
Signed-off-by: default avatarVincent Whitchurch <vincent.whitchurch@axis.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba01cea2
...@@ -88,8 +88,8 @@ struct scif_driver { ...@@ -88,8 +88,8 @@ struct scif_driver {
* @send_intr: Send an interrupt to the remote node on a specified doorbell. * @send_intr: Send an interrupt to the remote node on a specified doorbell.
* @send_p2p_intr: Send an interrupt to the peer node on a specified doorbell * @send_p2p_intr: Send an interrupt to the peer node on a specified doorbell
* which is specifically targeted for a peer to peer node. * which is specifically targeted for a peer to peer node.
* @ioremap: Map a buffer with the specified physical address and length. * @remap: Map a buffer with the specified physical address and length.
* @iounmap: Unmap a buffer previously mapped. * @unmap: Unmap a buffer previously mapped.
*/ */
struct scif_hw_ops { struct scif_hw_ops {
int (*next_db)(struct scif_hw_dev *sdev); int (*next_db)(struct scif_hw_dev *sdev);
...@@ -104,9 +104,9 @@ struct scif_hw_ops { ...@@ -104,9 +104,9 @@ struct scif_hw_ops {
void (*send_intr)(struct scif_hw_dev *sdev, int db); void (*send_intr)(struct scif_hw_dev *sdev, int db);
void (*send_p2p_intr)(struct scif_hw_dev *sdev, int db, void (*send_p2p_intr)(struct scif_hw_dev *sdev, int db,
struct mic_mw *mw); struct mic_mw *mw);
void __iomem * (*ioremap)(struct scif_hw_dev *sdev, void __iomem * (*remap)(struct scif_hw_dev *sdev,
phys_addr_t pa, size_t len); phys_addr_t pa, size_t len);
void (*iounmap)(struct scif_hw_dev *sdev, void __iomem *va); void (*unmap)(struct scif_hw_dev *sdev, void __iomem *va);
}; };
int scif_register_driver(struct scif_driver *driver); int scif_register_driver(struct scif_driver *driver);
......
...@@ -87,8 +87,8 @@ struct vop_driver { ...@@ -87,8 +87,8 @@ struct vop_driver {
* @get_dp: Get access to the virtio device page used by the self * @get_dp: Get access to the virtio device page used by the self
* node to add/remove/configure virtio devices. * node to add/remove/configure virtio devices.
* @send_intr: Send an interrupt to the peer node on a specified doorbell. * @send_intr: Send an interrupt to the peer node on a specified doorbell.
* @ioremap: Map a buffer with the specified DMA address and length. * @remap: Map a buffer with the specified DMA address and length.
* @iounmap: Unmap a buffer previously mapped. * @unmap: Unmap a buffer previously mapped.
* @dma_filter: The DMA filter function to use for obtaining access to * @dma_filter: The DMA filter function to use for obtaining access to
* a DMA channel on the peer node. * a DMA channel on the peer node.
*/ */
...@@ -104,9 +104,9 @@ struct vop_hw_ops { ...@@ -104,9 +104,9 @@ struct vop_hw_ops {
void __iomem * (*get_remote_dp)(struct vop_device *vpdev); void __iomem * (*get_remote_dp)(struct vop_device *vpdev);
void * (*get_dp)(struct vop_device *vpdev); void * (*get_dp)(struct vop_device *vpdev);
void (*send_intr)(struct vop_device *vpdev, int db); void (*send_intr)(struct vop_device *vpdev, int db);
void __iomem * (*ioremap)(struct vop_device *vpdev, void __iomem * (*remap)(struct vop_device *vpdev,
dma_addr_t pa, size_t len); dma_addr_t pa, size_t len);
void (*iounmap)(struct vop_device *vpdev, void __iomem *va); void (*unmap)(struct vop_device *vpdev, void __iomem *va);
}; };
struct vop_device * struct vop_device *
......
...@@ -245,8 +245,8 @@ static struct scif_hw_ops scif_hw_ops = { ...@@ -245,8 +245,8 @@ static struct scif_hw_ops scif_hw_ops = {
.next_db = ___mic_next_db, .next_db = ___mic_next_db,
.send_intr = ___mic_send_intr, .send_intr = ___mic_send_intr,
.send_p2p_intr = ___mic_send_p2p_intr, .send_p2p_intr = ___mic_send_p2p_intr,
.ioremap = ___mic_ioremap, .remap = ___mic_ioremap,
.iounmap = ___mic_iounmap, .unmap = ___mic_iounmap,
}; };
static inline struct mic_driver *vpdev_to_mdrv(struct vop_device *vpdev) static inline struct mic_driver *vpdev_to_mdrv(struct vop_device *vpdev)
...@@ -316,8 +316,8 @@ static struct vop_hw_ops vop_hw_ops = { ...@@ -316,8 +316,8 @@ static struct vop_hw_ops vop_hw_ops = {
.next_db = __mic_next_db, .next_db = __mic_next_db,
.get_remote_dp = __mic_get_remote_dp, .get_remote_dp = __mic_get_remote_dp,
.send_intr = __mic_send_intr, .send_intr = __mic_send_intr,
.ioremap = __mic_ioremap, .remap = __mic_ioremap,
.iounmap = __mic_iounmap, .unmap = __mic_iounmap,
}; };
static int mic_request_dma_chans(struct mic_driver *mdrv) static int mic_request_dma_chans(struct mic_driver *mdrv)
......
...@@ -133,8 +133,8 @@ static struct vop_hw_ops vop_hw_ops = { ...@@ -133,8 +133,8 @@ static struct vop_hw_ops vop_hw_ops = {
.get_dp = __mic_get_dp, .get_dp = __mic_get_dp,
.get_remote_dp = __mic_get_remote_dp, .get_remote_dp = __mic_get_remote_dp,
.send_intr = __mic_send_intr, .send_intr = __mic_send_intr,
.ioremap = __mic_ioremap, .remap = __mic_ioremap,
.iounmap = __mic_iounmap, .unmap = __mic_iounmap,
}; };
static inline struct mic_device *scdev_to_mdev(struct scif_hw_dev *scdev) static inline struct mic_device *scdev_to_mdev(struct scif_hw_dev *scdev)
...@@ -315,8 +315,8 @@ static struct scif_hw_ops scif_hw_ops = { ...@@ -315,8 +315,8 @@ static struct scif_hw_ops scif_hw_ops = {
.ack_interrupt = ___mic_ack_interrupt, .ack_interrupt = ___mic_ack_interrupt,
.next_db = ___mic_next_db, .next_db = ___mic_next_db,
.send_intr = ___mic_send_intr, .send_intr = ___mic_send_intr,
.ioremap = ___mic_ioremap, .remap = ___mic_ioremap,
.iounmap = ___mic_iounmap, .unmap = ___mic_iounmap,
}; };
static inline struct mic_device *mbdev_to_mdev(struct mbus_device *mbdev) static inline struct mic_device *mbdev_to_mdev(struct mbus_device *mbdev)
......
...@@ -97,7 +97,7 @@ scif_ioremap(dma_addr_t phys, size_t size, struct scif_dev *scifdev) ...@@ -97,7 +97,7 @@ scif_ioremap(dma_addr_t phys, size_t size, struct scif_dev *scifdev)
out_virt = phys_to_virt(phys); out_virt = phys_to_virt(phys);
else else
out_virt = (void __force *) out_virt = (void __force *)
sdev->hw_ops->ioremap(sdev, phys, size); sdev->hw_ops->remap(sdev, phys, size);
return out_virt; return out_virt;
} }
...@@ -107,7 +107,7 @@ scif_iounmap(void *virt, size_t len, struct scif_dev *scifdev) ...@@ -107,7 +107,7 @@ scif_iounmap(void *virt, size_t len, struct scif_dev *scifdev)
if (!scifdev_self(scifdev)) { if (!scifdev_self(scifdev)) {
struct scif_hw_dev *sdev = scifdev->sdev; struct scif_hw_dev *sdev = scifdev->sdev;
sdev->hw_ops->iounmap(sdev, (void __force __iomem *)virt); sdev->hw_ops->unmap(sdev, (void __force __iomem *)virt);
} }
} }
......
...@@ -270,7 +270,7 @@ static void vop_del_vq(struct virtqueue *vq, int n) ...@@ -270,7 +270,7 @@ static void vop_del_vq(struct virtqueue *vq, int n)
free_pages((unsigned long)vdev->used_virt[n], free_pages((unsigned long)vdev->used_virt[n],
get_order(vdev->used_size[n])); get_order(vdev->used_size[n]));
vring_del_virtqueue(vq); vring_del_virtqueue(vq);
vpdev->hw_ops->iounmap(vpdev, vdev->vr[n]); vpdev->hw_ops->unmap(vpdev, vdev->vr[n]);
vdev->vr[n] = NULL; vdev->vr[n] = NULL;
} }
...@@ -338,8 +338,7 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev, ...@@ -338,8 +338,7 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev,
memcpy_fromio(&config, vqconfig, sizeof(config)); memcpy_fromio(&config, vqconfig, sizeof(config));
_vr_size = vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN); _vr_size = vring_size(le16_to_cpu(config.num), MIC_VIRTIO_RING_ALIGN);
vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info)); vr_size = PAGE_ALIGN(_vr_size + sizeof(struct _mic_vring_info));
va = vpdev->hw_ops->ioremap(vpdev, le64_to_cpu(config.address), va = vpdev->hw_ops->remap(vpdev, le64_to_cpu(config.address), vr_size);
vr_size);
if (!va) if (!va)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
vdev->vr[index] = va; vdev->vr[index] = va;
...@@ -393,7 +392,7 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev, ...@@ -393,7 +392,7 @@ static struct virtqueue *vop_find_vq(struct virtio_device *dev,
free_pages((unsigned long)used, free_pages((unsigned long)used,
get_order(vdev->used_size[index])); get_order(vdev->used_size[index]));
unmap: unmap:
vpdev->hw_ops->iounmap(vpdev, vdev->vr[index]); vpdev->hw_ops->unmap(vpdev, vdev->vr[index]);
return ERR_PTR(err); return ERR_PTR(err);
} }
......
...@@ -80,7 +80,7 @@ static void vop_virtio_init_post(struct vop_vdev *vdev) ...@@ -80,7 +80,7 @@ static void vop_virtio_init_post(struct vop_vdev *vdev)
continue; continue;
} }
vdev->vvr[i].vrh.vring.used = vdev->vvr[i].vrh.vring.used =
(void __force *)vpdev->hw_ops->ioremap( (void __force *)vpdev->hw_ops->remap(
vpdev, vpdev,
le64_to_cpu(vqconfig[i].used_address), le64_to_cpu(vqconfig[i].used_address),
used_size); used_size);
...@@ -528,7 +528,7 @@ static int vop_virtio_copy_to_user(struct vop_vdev *vdev, void __user *ubuf, ...@@ -528,7 +528,7 @@ static int vop_virtio_copy_to_user(struct vop_vdev *vdev, void __user *ubuf,
int vr_idx) int vr_idx)
{ {
struct vop_device *vpdev = vdev->vpdev; struct vop_device *vpdev = vdev->vpdev;
void __iomem *dbuf = vpdev->hw_ops->ioremap(vpdev, daddr, len); void __iomem *dbuf = vpdev->hw_ops->remap(vpdev, daddr, len);
struct vop_vringh *vvr = &vdev->vvr[vr_idx]; struct vop_vringh *vvr = &vdev->vvr[vr_idx];
struct vop_info *vi = dev_get_drvdata(&vpdev->dev); struct vop_info *vi = dev_get_drvdata(&vpdev->dev);
size_t dma_alignment; size_t dma_alignment;
...@@ -588,7 +588,7 @@ static int vop_virtio_copy_to_user(struct vop_vdev *vdev, void __user *ubuf, ...@@ -588,7 +588,7 @@ static int vop_virtio_copy_to_user(struct vop_vdev *vdev, void __user *ubuf,
} }
err = 0; err = 0;
err: err:
vpdev->hw_ops->iounmap(vpdev, dbuf); vpdev->hw_ops->unmap(vpdev, dbuf);
dev_dbg(vop_dev(vdev), dev_dbg(vop_dev(vdev),
"%s: ubuf %p dbuf %p len 0x%zx vr_idx 0x%x\n", "%s: ubuf %p dbuf %p len 0x%zx vr_idx 0x%x\n",
__func__, ubuf, dbuf, len, vr_idx); __func__, ubuf, dbuf, len, vr_idx);
...@@ -606,7 +606,7 @@ static int vop_virtio_copy_from_user(struct vop_vdev *vdev, void __user *ubuf, ...@@ -606,7 +606,7 @@ static int vop_virtio_copy_from_user(struct vop_vdev *vdev, void __user *ubuf,
int vr_idx) int vr_idx)
{ {
struct vop_device *vpdev = vdev->vpdev; struct vop_device *vpdev = vdev->vpdev;
void __iomem *dbuf = vpdev->hw_ops->ioremap(vpdev, daddr, len); void __iomem *dbuf = vpdev->hw_ops->remap(vpdev, daddr, len);
struct vop_vringh *vvr = &vdev->vvr[vr_idx]; struct vop_vringh *vvr = &vdev->vvr[vr_idx];
struct vop_info *vi = dev_get_drvdata(&vdev->vpdev->dev); struct vop_info *vi = dev_get_drvdata(&vdev->vpdev->dev);
size_t dma_alignment; size_t dma_alignment;
...@@ -676,7 +676,7 @@ static int vop_virtio_copy_from_user(struct vop_vdev *vdev, void __user *ubuf, ...@@ -676,7 +676,7 @@ static int vop_virtio_copy_from_user(struct vop_vdev *vdev, void __user *ubuf,
vdev->out_bytes += len; vdev->out_bytes += len;
err = 0; err = 0;
err: err:
vpdev->hw_ops->iounmap(vpdev, dbuf); vpdev->hw_ops->unmap(vpdev, dbuf);
dev_dbg(vop_dev(vdev), dev_dbg(vop_dev(vdev),
"%s: ubuf %p dbuf %p len 0x%zx vr_idx 0x%x\n", "%s: ubuf %p dbuf %p len 0x%zx vr_idx 0x%x\n",
__func__, ubuf, dbuf, len, vr_idx); __func__, ubuf, dbuf, len, vr_idx);
......
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