aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/3w-sas.c5
-rw-r--r--drivers/scsi/a100u2w.c8
-rw-r--r--drivers/scsi/be2iscsi/be_main.c10
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c3
-rw-r--r--drivers/scsi/csiostor/csio_wr.c8
-rw-r--r--drivers/scsi/eata.c5
-rw-r--r--drivers/scsi/hpsa.c8
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c16
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c8
-rw-r--r--drivers/scsi/mesh.c6
-rw-r--r--drivers/scsi/mvumi.c9
-rw-r--r--drivers/scsi/pm8001/pm8001_sas.c5
12 files changed, 32 insertions, 59 deletions
diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index 4de346017e9f..6da6cec9a651 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -683,14 +683,13 @@ static int twl_allocate_memory(TW_Device_Extension *tw_dev, int size, int which)
683 unsigned long *cpu_addr; 683 unsigned long *cpu_addr;
684 int retval = 1; 684 int retval = 1;
685 685
686 cpu_addr = pci_alloc_consistent(tw_dev->tw_pci_dev, size*TW_Q_LENGTH, &dma_handle); 686 cpu_addr = pci_zalloc_consistent(tw_dev->tw_pci_dev, size * TW_Q_LENGTH,
687 &dma_handle);
687 if (!cpu_addr) { 688 if (!cpu_addr) {
688 TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed"); 689 TW_PRINTK(tw_dev->host, TW_DRIVER, 0x5, "Memory allocation failed");
689 goto out; 690 goto out;
690 } 691 }
691 692
692 memset(cpu_addr, 0, size*TW_Q_LENGTH);
693
694 for (i = 0; i < TW_Q_LENGTH; i++) { 693 for (i = 0; i < TW_Q_LENGTH; i++) {
695 switch(which) { 694 switch(which) {
696 case 0: 695 case 0:
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index 522570d297ca..7e33a61c1ba4 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -1125,23 +1125,19 @@ static int inia100_probe_one(struct pci_dev *pdev,
1125 1125
1126 /* Get total memory needed for SCB */ 1126 /* Get total memory needed for SCB */
1127 sz = ORC_MAXQUEUE * sizeof(struct orc_scb); 1127 sz = ORC_MAXQUEUE * sizeof(struct orc_scb);
1128 host->scb_virt = pci_alloc_consistent(pdev, sz, 1128 host->scb_virt = pci_zalloc_consistent(pdev, sz, &host->scb_phys);
1129 &host->scb_phys);
1130 if (!host->scb_virt) { 1129 if (!host->scb_virt) {
1131 printk("inia100: SCB memory allocation error\n"); 1130 printk("inia100: SCB memory allocation error\n");
1132 goto out_host_put; 1131 goto out_host_put;
1133 } 1132 }
1134 memset(host->scb_virt, 0, sz);
1135 1133
1136 /* Get total memory needed for ESCB */ 1134 /* Get total memory needed for ESCB */
1137 sz = ORC_MAXQUEUE * sizeof(struct orc_extended_scb); 1135 sz = ORC_MAXQUEUE * sizeof(struct orc_extended_scb);
1138 host->escb_virt = pci_alloc_consistent(pdev, sz, 1136 host->escb_virt = pci_zalloc_consistent(pdev, sz, &host->escb_phys);
1139 &host->escb_phys);
1140 if (!host->escb_virt) { 1137 if (!host->escb_virt) {
1141 printk("inia100: ESCB memory allocation error\n"); 1138 printk("inia100: ESCB memory allocation error\n");
1142 goto out_free_scb_array; 1139 goto out_free_scb_array;
1143 } 1140 }
1144 memset(host->escb_virt, 0, sz);
1145 1141
1146 biosaddr = host->BIOScfg; 1142 biosaddr = host->BIOScfg;
1147 biosaddr = (biosaddr << 4); 1143 biosaddr = (biosaddr << 4);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 56467df3d6de..eb3e3e619155 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -3538,10 +3538,9 @@ static int be_queue_alloc(struct beiscsi_hba *phba, struct be_queue_info *q,
3538 q->len = len; 3538 q->len = len;
3539 q->entry_size = entry_size; 3539 q->entry_size = entry_size;
3540 mem->size = len * entry_size; 3540 mem->size = len * entry_size;
3541 mem->va = pci_alloc_consistent(phba->pcidev, mem->size, &mem->dma); 3541 mem->va = pci_zalloc_consistent(phba->pcidev, mem->size, &mem->dma);
3542 if (!mem->va) 3542 if (!mem->va)
3543 return -ENOMEM; 3543 return -ENOMEM;
3544 memset(mem->va, 0, mem->size);
3545 return 0; 3544 return 0;
3546} 3545}
3547 3546
@@ -4320,9 +4319,9 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
4320 "BM_%d : No boot session\n"); 4319 "BM_%d : No boot session\n");
4321 return ret; 4320 return ret;
4322 } 4321 }
4323 nonemb_cmd.va = pci_alloc_consistent(phba->ctrl.pdev, 4322 nonemb_cmd.va = pci_zalloc_consistent(phba->ctrl.pdev,
4324 sizeof(*session_resp), 4323 sizeof(*session_resp),
4325 &nonemb_cmd.dma); 4324 &nonemb_cmd.dma);
4326 if (nonemb_cmd.va == NULL) { 4325 if (nonemb_cmd.va == NULL) {
4327 beiscsi_log(phba, KERN_ERR, 4326 beiscsi_log(phba, KERN_ERR,
4328 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG, 4327 BEISCSI_LOG_INIT | BEISCSI_LOG_CONFIG,
@@ -4332,7 +4331,6 @@ static int beiscsi_get_boot_info(struct beiscsi_hba *phba)
4332 return -ENOMEM; 4331 return -ENOMEM;
4333 } 4332 }
4334 4333
4335 memset(nonemb_cmd.va, 0, sizeof(*session_resp));
4336 tag = mgmt_get_session_info(phba, s_handle, 4334 tag = mgmt_get_session_info(phba, s_handle,
4337 &nonemb_cmd); 4335 &nonemb_cmd);
4338 if (!tag) { 4336 if (!tag) {
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index a3e56487616c..665afcb74a56 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -900,13 +900,12 @@ free_cmd:
900static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd, 900static int mgmt_alloc_cmd_data(struct beiscsi_hba *phba, struct be_dma_mem *cmd,
901 int iscsi_cmd, int size) 901 int iscsi_cmd, int size)
902{ 902{
903 cmd->va = pci_alloc_consistent(phba->ctrl.pdev, size, &cmd->dma); 903 cmd->va = pci_zalloc_consistent(phba->ctrl.pdev, size, &cmd->dma);
904 if (!cmd->va) { 904 if (!cmd->va) {
905 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, 905 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG,
906 "BG_%d : Failed to allocate memory for if info\n"); 906 "BG_%d : Failed to allocate memory for if info\n");
907 return -ENOMEM; 907 return -ENOMEM;
908 } 908 }
909 memset(cmd->va, 0, size);
910 cmd->size = size; 909 cmd->size = size;
911 be_cmd_hdr_prepare(cmd->va, CMD_SUBSYSTEM_ISCSI, iscsi_cmd, size); 910 be_cmd_hdr_prepare(cmd->va, CMD_SUBSYSTEM_ISCSI, iscsi_cmd, size);
912 return 0; 911 return 0;
diff --git a/drivers/scsi/csiostor/csio_wr.c b/drivers/scsi/csiostor/csio_wr.c
index 4255ce264abf..773da14cfa14 100644
--- a/drivers/scsi/csiostor/csio_wr.c
+++ b/drivers/scsi/csiostor/csio_wr.c
@@ -232,7 +232,7 @@ csio_wr_alloc_q(struct csio_hw *hw, uint32_t qsize, uint32_t wrsize,
232 232
233 q = wrm->q_arr[free_idx]; 233 q = wrm->q_arr[free_idx];
234 234
235 q->vstart = pci_alloc_consistent(hw->pdev, qsz, &q->pstart); 235 q->vstart = pci_zalloc_consistent(hw->pdev, qsz, &q->pstart);
236 if (!q->vstart) { 236 if (!q->vstart) {
237 csio_err(hw, 237 csio_err(hw,
238 "Failed to allocate DMA memory for " 238 "Failed to allocate DMA memory for "
@@ -240,12 +240,6 @@ csio_wr_alloc_q(struct csio_hw *hw, uint32_t qsize, uint32_t wrsize,
240 return -1; 240 return -1;
241 } 241 }
242 242
243 /*
244 * We need to zero out the contents, importantly for ingress,
245 * since we start with a generatiom bit of 1 for ingress.
246 */
247 memset(q->vstart, 0, qsz);
248
249 q->type = type; 243 q->type = type;
250 q->owner = owner; 244 q->owner = owner;
251 q->pidx = q->cidx = q->inc_idx = 0; 245 q->pidx = q->cidx = q->inc_idx = 0;
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index 03372cff38f3..813dd5c998e4 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -1238,8 +1238,8 @@ static int port_detect(unsigned long port_base, unsigned int j,
1238 struct eata_config *cf; 1238 struct eata_config *cf;
1239 dma_addr_t cf_dma_addr; 1239 dma_addr_t cf_dma_addr;
1240 1240
1241 cf = pci_alloc_consistent(pdev, sizeof(struct eata_config), 1241 cf = pci_zalloc_consistent(pdev, sizeof(struct eata_config),
1242 &cf_dma_addr); 1242 &cf_dma_addr);
1243 1243
1244 if (!cf) { 1244 if (!cf) {
1245 printk 1245 printk
@@ -1249,7 +1249,6 @@ static int port_detect(unsigned long port_base, unsigned int j,
1249 } 1249 }
1250 1250
1251 /* Set board configuration */ 1251 /* Set board configuration */
1252 memset((char *)cf, 0, sizeof(struct eata_config));
1253 cf->len = (ushort) H2DEV16((ushort) 510); 1252 cf->len = (ushort) H2DEV16((ushort) 510);
1254 cf->ocena = 1; 1253 cf->ocena = 1;
1255 1254
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 8545d1826725..6b35d0dfe64c 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4732,23 +4732,21 @@ static struct CommandList *cmd_special_alloc(struct ctlr_info *h)
4732 union u64bit temp64; 4732 union u64bit temp64;
4733 dma_addr_t cmd_dma_handle, err_dma_handle; 4733 dma_addr_t cmd_dma_handle, err_dma_handle;
4734 4734
4735 c = pci_alloc_consistent(h->pdev, sizeof(*c), &cmd_dma_handle); 4735 c = pci_zalloc_consistent(h->pdev, sizeof(*c), &cmd_dma_handle);
4736 if (c == NULL) 4736 if (c == NULL)
4737 return NULL; 4737 return NULL;
4738 memset(c, 0, sizeof(*c));
4739 4738
4740 c->cmd_type = CMD_SCSI; 4739 c->cmd_type = CMD_SCSI;
4741 c->cmdindex = -1; 4740 c->cmdindex = -1;
4742 4741
4743 c->err_info = pci_alloc_consistent(h->pdev, sizeof(*c->err_info), 4742 c->err_info = pci_zalloc_consistent(h->pdev, sizeof(*c->err_info),
4744 &err_dma_handle); 4743 &err_dma_handle);
4745 4744
4746 if (c->err_info == NULL) { 4745 if (c->err_info == NULL) {
4747 pci_free_consistent(h->pdev, 4746 pci_free_consistent(h->pdev,
4748 sizeof(*c), c, cmd_dma_handle); 4747 sizeof(*c), c, cmd_dma_handle);
4749 return NULL; 4748 return NULL;
4750 } 4749 }
4751 memset(c->err_info, 0, sizeof(*c->err_info));
4752 4750
4753 INIT_LIST_HEAD(&c->list); 4751 INIT_LIST_HEAD(&c->list);
4754 c->busaddr = (u32) cmd_dma_handle; 4752 c->busaddr = (u32) cmd_dma_handle;
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index e2237a97cb9d..531dce419c18 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -998,8 +998,9 @@ megaraid_alloc_cmd_packets(adapter_t *adapter)
998 * Allocate the common 16-byte aligned memory for the handshake 998 * Allocate the common 16-byte aligned memory for the handshake
999 * mailbox. 999 * mailbox.
1000 */ 1000 */
1001 raid_dev->una_mbox64 = pci_alloc_consistent(adapter->pdev, 1001 raid_dev->una_mbox64 = pci_zalloc_consistent(adapter->pdev,
1002 sizeof(mbox64_t), &raid_dev->una_mbox64_dma); 1002 sizeof(mbox64_t),
1003 &raid_dev->una_mbox64_dma);
1003 1004
1004 if (!raid_dev->una_mbox64) { 1005 if (!raid_dev->una_mbox64) {
1005 con_log(CL_ANN, (KERN_WARNING 1006 con_log(CL_ANN, (KERN_WARNING
@@ -1007,7 +1008,6 @@ megaraid_alloc_cmd_packets(adapter_t *adapter)
1007 __LINE__)); 1008 __LINE__));
1008 return -1; 1009 return -1;
1009 } 1010 }
1010 memset(raid_dev->una_mbox64, 0, sizeof(mbox64_t));
1011 1011
1012 /* 1012 /*
1013 * Align the mailbox at 16-byte boundary 1013 * Align the mailbox at 16-byte boundary
@@ -1026,8 +1026,8 @@ megaraid_alloc_cmd_packets(adapter_t *adapter)
1026 align; 1026 align;
1027 1027
1028 // Allocate memory for commands issued internally 1028 // Allocate memory for commands issued internally
1029 adapter->ibuf = pci_alloc_consistent(pdev, MBOX_IBUF_SIZE, 1029 adapter->ibuf = pci_zalloc_consistent(pdev, MBOX_IBUF_SIZE,
1030 &adapter->ibuf_dma_h); 1030 &adapter->ibuf_dma_h);
1031 if (!adapter->ibuf) { 1031 if (!adapter->ibuf) {
1032 1032
1033 con_log(CL_ANN, (KERN_WARNING 1033 con_log(CL_ANN, (KERN_WARNING
@@ -1036,7 +1036,6 @@ megaraid_alloc_cmd_packets(adapter_t *adapter)
1036 1036
1037 goto out_free_common_mbox; 1037 goto out_free_common_mbox;
1038 } 1038 }
1039 memset(adapter->ibuf, 0, MBOX_IBUF_SIZE);
1040 1039
1041 // Allocate memory for our SCSI Command Blocks and their associated 1040 // Allocate memory for our SCSI Command Blocks and their associated
1042 // memory 1041 // memory
@@ -2972,8 +2971,8 @@ megaraid_mbox_product_info(adapter_t *adapter)
2972 * Issue an ENQUIRY3 command to find out certain adapter parameters, 2971 * Issue an ENQUIRY3 command to find out certain adapter parameters,
2973 * e.g., max channels, max commands etc. 2972 * e.g., max channels, max commands etc.
2974 */ 2973 */
2975 pinfo = pci_alloc_consistent(adapter->pdev, sizeof(mraid_pinfo_t), 2974 pinfo = pci_zalloc_consistent(adapter->pdev, sizeof(mraid_pinfo_t),
2976 &pinfo_dma_h); 2975 &pinfo_dma_h);
2977 2976
2978 if (pinfo == NULL) { 2977 if (pinfo == NULL) {
2979 con_log(CL_ANN, (KERN_WARNING 2978 con_log(CL_ANN, (KERN_WARNING
@@ -2982,7 +2981,6 @@ megaraid_mbox_product_info(adapter_t *adapter)
2982 2981
2983 return -1; 2982 return -1;
2984 } 2983 }
2985 memset(pinfo, 0, sizeof(mraid_pinfo_t));
2986 2984
2987 mbox->xferaddr = (uint32_t)adapter->ibuf_dma_h; 2985 mbox->xferaddr = (uint32_t)adapter->ibuf_dma_h;
2988 memset((void *)adapter->ibuf, 0, MBOX_IBUF_SIZE); 2986 memset((void *)adapter->ibuf, 0, MBOX_IBUF_SIZE);
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 112799b131a9..22a04e37b70a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -2038,9 +2038,9 @@ int megasas_sriov_start_heartbeat(struct megasas_instance *instance,
2038 2038
2039 if (initial) { 2039 if (initial) {
2040 instance->hb_host_mem = 2040 instance->hb_host_mem =
2041 pci_alloc_consistent(instance->pdev, 2041 pci_zalloc_consistent(instance->pdev,
2042 sizeof(struct MR_CTRL_HB_HOST_MEM), 2042 sizeof(struct MR_CTRL_HB_HOST_MEM),
2043 &instance->hb_host_mem_h); 2043 &instance->hb_host_mem_h);
2044 if (!instance->hb_host_mem) { 2044 if (!instance->hb_host_mem) {
2045 printk(KERN_DEBUG "megasas: SR-IOV: Couldn't allocate" 2045 printk(KERN_DEBUG "megasas: SR-IOV: Couldn't allocate"
2046 " memory for heartbeat host memory for " 2046 " memory for heartbeat host memory for "
@@ -2048,8 +2048,6 @@ int megasas_sriov_start_heartbeat(struct megasas_instance *instance,
2048 retval = -ENOMEM; 2048 retval = -ENOMEM;
2049 goto out; 2049 goto out;
2050 } 2050 }
2051 memset(instance->hb_host_mem, 0,
2052 sizeof(struct MR_CTRL_HB_HOST_MEM));
2053 } 2051 }
2054 2052
2055 memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE); 2053 memset(dcmd->mbox.b, 0, MFI_MBOX_SIZE);
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index 7a6160f172ce..57a95e2c3442 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1915,14 +1915,12 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
1915 /* We use the PCI APIs for now until the generic one gets fixed 1915 /* We use the PCI APIs for now until the generic one gets fixed
1916 * enough or until we get some macio-specific versions 1916 * enough or until we get some macio-specific versions
1917 */ 1917 */
1918 dma_cmd_space = pci_alloc_consistent(macio_get_pci_dev(mdev), 1918 dma_cmd_space = pci_zalloc_consistent(macio_get_pci_dev(mdev),
1919 ms->dma_cmd_size, 1919 ms->dma_cmd_size, &dma_cmd_bus);
1920 &dma_cmd_bus);
1921 if (dma_cmd_space == NULL) { 1920 if (dma_cmd_space == NULL) {
1922 printk(KERN_ERR "mesh: can't allocate DMA table\n"); 1921 printk(KERN_ERR "mesh: can't allocate DMA table\n");
1923 goto out_unmap; 1922 goto out_unmap;
1924 } 1923 }
1925 memset(dma_cmd_space, 0, ms->dma_cmd_size);
1926 1924
1927 ms->dma_cmds = (struct dbdma_cmd *) DBDMA_ALIGN(dma_cmd_space); 1925 ms->dma_cmds = (struct dbdma_cmd *) DBDMA_ALIGN(dma_cmd_space);
1928 ms->dma_cmd_space = dma_cmd_space; 1926 ms->dma_cmd_space = dma_cmd_space;
diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index edbee8dc62c9..3e716b2f611a 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -142,8 +142,8 @@ static struct mvumi_res *mvumi_alloc_mem_resource(struct mvumi_hba *mhba,
142 142
143 case RESOURCE_UNCACHED_MEMORY: 143 case RESOURCE_UNCACHED_MEMORY:
144 size = round_up(size, 8); 144 size = round_up(size, 8);
145 res->virt_addr = pci_alloc_consistent(mhba->pdev, size, 145 res->virt_addr = pci_zalloc_consistent(mhba->pdev, size,
146 &res->bus_addr); 146 &res->bus_addr);
147 if (!res->virt_addr) { 147 if (!res->virt_addr) {
148 dev_err(&mhba->pdev->dev, 148 dev_err(&mhba->pdev->dev,
149 "unable to allocate consistent mem," 149 "unable to allocate consistent mem,"
@@ -151,7 +151,6 @@ static struct mvumi_res *mvumi_alloc_mem_resource(struct mvumi_hba *mhba,
151 kfree(res); 151 kfree(res);
152 return NULL; 152 return NULL;
153 } 153 }
154 memset(res->virt_addr, 0, size);
155 break; 154 break;
156 155
157 default: 156 default:
@@ -258,12 +257,10 @@ static int mvumi_internal_cmd_sgl(struct mvumi_hba *mhba, struct mvumi_cmd *cmd,
258 if (size == 0) 257 if (size == 0)
259 return 0; 258 return 0;
260 259
261 virt_addr = pci_alloc_consistent(mhba->pdev, size, &phy_addr); 260 virt_addr = pci_zalloc_consistent(mhba->pdev, size, &phy_addr);
262 if (!virt_addr) 261 if (!virt_addr)
263 return -1; 262 return -1;
264 263
265 memset(virt_addr, 0, size);
266
267 m_sg = (struct mvumi_sgl *) &cmd->frame->payload[0]; 264 m_sg = (struct mvumi_sgl *) &cmd->frame->payload[0];
268 cmd->frame->sg_counts = 1; 265 cmd->frame->sg_counts = 1;
269 cmd->data_buf = virt_addr; 266 cmd->data_buf = virt_addr;
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 34cea8291772..76570e6a547d 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -116,13 +116,12 @@ int pm8001_mem_alloc(struct pci_dev *pdev, void **virt_addr,
116 u64 align_offset = 0; 116 u64 align_offset = 0;
117 if (align) 117 if (align)
118 align_offset = (dma_addr_t)align - 1; 118 align_offset = (dma_addr_t)align - 1;
119 mem_virt_alloc = 119 mem_virt_alloc = pci_zalloc_consistent(pdev, mem_size + align,
120 pci_alloc_consistent(pdev, mem_size + align, &mem_dma_handle); 120 &mem_dma_handle);
121 if (!mem_virt_alloc) { 121 if (!mem_virt_alloc) {
122 pm8001_printk("memory allocation error\n"); 122 pm8001_printk("memory allocation error\n");
123 return -1; 123 return -1;
124 } 124 }
125 memset((void *)mem_virt_alloc, 0, mem_size+align);
126 *pphys_addr = mem_dma_handle; 125 *pphys_addr = mem_dma_handle;
127 phys_align = (*pphys_addr + align_offset) & ~align_offset; 126 phys_align = (*pphys_addr + align_offset) & ~align_offset;
128 *virt_addr = (void *)mem_virt_alloc + phys_align - *pphys_addr; 127 *virt_addr = (void *)mem_virt_alloc + phys_align - *pphys_addr;