X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Ffc4%2Fsocal.c;h=922e9613b2cf547fe6c708d2c5a7aab4af1d33fc;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=e158d7d265eb527ab7ea258e52d91d3e46076e16;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/drivers/fc4/socal.c b/drivers/fc4/socal.c index e158d7d26..922e9613b 100644 --- a/drivers/fc4/socal.c +++ b/drivers/fc4/socal.c @@ -27,8 +27,8 @@ static char *version = #include #include #include +#include #include -#include #include #include #include @@ -60,7 +60,7 @@ static char *version = #define for_each_socal(s) for (s = socals; s; s = s->next) struct socal *socals = NULL; -static void socal_copy_from_xram(void *d, unsigned long xram, long size) +static void socal_copy_from_xram(void *d, void __iomem *xram, long size) { u32 *dp = (u32 *) d; while (size) { @@ -70,7 +70,7 @@ static void socal_copy_from_xram(void *d, unsigned long xram, long size) } } -static void socal_copy_to_xram(unsigned long xram, void *s, long size) +static void socal_copy_to_xram(void __iomem *xram, void *s, long size) { u32 *sp = (u32 *) s; while (size) { @@ -665,9 +665,8 @@ static inline void socal_init(struct sbus_dev *sdev, int no) int size, i; int irq, node; - s = kmalloc (sizeof (struct socal), GFP_KERNEL); + s = kzalloc (sizeof (struct socal), GFP_KERNEL); if (!s) return; - memset (s, 0, sizeof(struct socal)); spin_lock_init(&s->lock); s->socal_no = no; @@ -800,11 +799,11 @@ static inline void socal_init(struct sbus_dev *sdev, int no) s->rsp[1].pool = s->rsp[0].pool + SOCAL_CQ_RSP0_SIZE; s->rsp[2].pool = s->rsp[1].pool + SOCAL_CQ_RSP1_SIZE; - s->req[0].hw_cq = (socal_hw_cq *)(s->xram + SOCAL_CQ_REQ_OFFSET); - s->req[1].hw_cq = (socal_hw_cq *)(s->xram + SOCAL_CQ_REQ_OFFSET + sizeof(socal_hw_cq)); - s->rsp[0].hw_cq = (socal_hw_cq *)(s->xram + SOCAL_CQ_RSP_OFFSET); - s->rsp[1].hw_cq = (socal_hw_cq *)(s->xram + SOCAL_CQ_RSP_OFFSET + sizeof(socal_hw_cq)); - s->rsp[2].hw_cq = (socal_hw_cq *)(s->xram + SOCAL_CQ_RSP_OFFSET + 2 * sizeof(socal_hw_cq)); + s->req[0].hw_cq = (socal_hw_cq __iomem *)(s->xram + SOCAL_CQ_REQ_OFFSET); + s->req[1].hw_cq = (socal_hw_cq __iomem *)(s->xram + SOCAL_CQ_REQ_OFFSET + sizeof(socal_hw_cq)); + s->rsp[0].hw_cq = (socal_hw_cq __iomem *)(s->xram + SOCAL_CQ_RSP_OFFSET); + s->rsp[1].hw_cq = (socal_hw_cq __iomem *)(s->xram + SOCAL_CQ_RSP_OFFSET + sizeof(socal_hw_cq)); + s->rsp[2].hw_cq = (socal_hw_cq __iomem *)(s->xram + SOCAL_CQ_RSP_OFFSET + 2 * sizeof(socal_hw_cq)); cq[1].address = cq[0].address + (SOCAL_CQ_REQ0_SIZE * sizeof(socal_req)); cq[4].address = cq[1].address + (SOCAL_CQ_REQ1_SIZE * sizeof(socal_req));