mtd: gpmi: remove the unnecessary pr_err()
The error messages for the failure of dmaengine_prep_slave_sg are not necessary, this patch removes all these pr_err, and returns with the proper error code -EINVAL, not -1. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
4f0614a020
commit
43a34b8b73
|
@ -1128,10 +1128,8 @@ int gpmi_send_command(struct gpmi_nand_data *this)
|
||||||
desc = dmaengine_prep_slave_sg(channel,
|
desc = dmaengine_prep_slave_sg(channel,
|
||||||
(struct scatterlist *)pio,
|
(struct scatterlist *)pio,
|
||||||
ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
|
ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 1 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [2] send out the COMMAND + ADDRESS string stored in @buffer */
|
/* [2] send out the COMMAND + ADDRESS string stored in @buffer */
|
||||||
sgl = &this->cmd_sgl;
|
sgl = &this->cmd_sgl;
|
||||||
|
@ -1141,11 +1139,8 @@ int gpmi_send_command(struct gpmi_nand_data *this)
|
||||||
desc = dmaengine_prep_slave_sg(channel,
|
desc = dmaengine_prep_slave_sg(channel,
|
||||||
sgl, 1, DMA_MEM_TO_DEV,
|
sgl, 1, DMA_MEM_TO_DEV,
|
||||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||||
|
if (!desc)
|
||||||
if (!desc) {
|
return -EINVAL;
|
||||||
pr_err("step 2 error\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [3] submit the DMA */
|
/* [3] submit the DMA */
|
||||||
set_dma_type(this, DMA_FOR_COMMAND);
|
set_dma_type(this, DMA_FOR_COMMAND);
|
||||||
|
@ -1174,20 +1169,17 @@ int gpmi_send_data(struct gpmi_nand_data *this)
|
||||||
pio[1] = 0;
|
pio[1] = 0;
|
||||||
desc = dmaengine_prep_slave_sg(channel, (struct scatterlist *)pio,
|
desc = dmaengine_prep_slave_sg(channel, (struct scatterlist *)pio,
|
||||||
ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
|
ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 1 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [2] send DMA request */
|
/* [2] send DMA request */
|
||||||
prepare_data_dma(this, DMA_TO_DEVICE);
|
prepare_data_dma(this, DMA_TO_DEVICE);
|
||||||
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
|
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
|
||||||
1, DMA_MEM_TO_DEV,
|
1, DMA_MEM_TO_DEV,
|
||||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 2 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* [3] submit the DMA */
|
/* [3] submit the DMA */
|
||||||
set_dma_type(this, DMA_FOR_WRITE_DATA);
|
set_dma_type(this, DMA_FOR_WRITE_DATA);
|
||||||
return start_dma_without_bch_irq(this, desc);
|
return start_dma_without_bch_irq(this, desc);
|
||||||
|
@ -1211,20 +1203,16 @@ int gpmi_read_data(struct gpmi_nand_data *this)
|
||||||
desc = dmaengine_prep_slave_sg(channel,
|
desc = dmaengine_prep_slave_sg(channel,
|
||||||
(struct scatterlist *)pio,
|
(struct scatterlist *)pio,
|
||||||
ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
|
ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 1 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [2] : send DMA request */
|
/* [2] : send DMA request */
|
||||||
prepare_data_dma(this, DMA_FROM_DEVICE);
|
prepare_data_dma(this, DMA_FROM_DEVICE);
|
||||||
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
|
desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
|
||||||
1, DMA_DEV_TO_MEM,
|
1, DMA_DEV_TO_MEM,
|
||||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 2 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [3] : submit the DMA */
|
/* [3] : submit the DMA */
|
||||||
set_dma_type(this, DMA_FOR_READ_DATA);
|
set_dma_type(this, DMA_FOR_READ_DATA);
|
||||||
|
@ -1269,10 +1257,9 @@ int gpmi_send_page(struct gpmi_nand_data *this,
|
||||||
(struct scatterlist *)pio,
|
(struct scatterlist *)pio,
|
||||||
ARRAY_SIZE(pio), DMA_TRANS_NONE,
|
ARRAY_SIZE(pio), DMA_TRANS_NONE,
|
||||||
DMA_CTRL_ACK);
|
DMA_CTRL_ACK);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 2 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
set_dma_type(this, DMA_FOR_WRITE_ECC_PAGE);
|
set_dma_type(this, DMA_FOR_WRITE_ECC_PAGE);
|
||||||
return start_dma_with_bch_irq(this, desc);
|
return start_dma_with_bch_irq(this, desc);
|
||||||
}
|
}
|
||||||
|
@ -1304,10 +1291,8 @@ int gpmi_read_page(struct gpmi_nand_data *this,
|
||||||
desc = dmaengine_prep_slave_sg(channel,
|
desc = dmaengine_prep_slave_sg(channel,
|
||||||
(struct scatterlist *)pio, 2,
|
(struct scatterlist *)pio, 2,
|
||||||
DMA_TRANS_NONE, 0);
|
DMA_TRANS_NONE, 0);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 1 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [2] Enable the BCH block and read. */
|
/* [2] Enable the BCH block and read. */
|
||||||
command_mode = BV_GPMI_CTRL0_COMMAND_MODE__READ;
|
command_mode = BV_GPMI_CTRL0_COMMAND_MODE__READ;
|
||||||
|
@ -1334,10 +1319,8 @@ int gpmi_read_page(struct gpmi_nand_data *this,
|
||||||
(struct scatterlist *)pio,
|
(struct scatterlist *)pio,
|
||||||
ARRAY_SIZE(pio), DMA_TRANS_NONE,
|
ARRAY_SIZE(pio), DMA_TRANS_NONE,
|
||||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 2 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [3] Disable the BCH block */
|
/* [3] Disable the BCH block */
|
||||||
command_mode = BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY;
|
command_mode = BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY;
|
||||||
|
@ -1355,10 +1338,8 @@ int gpmi_read_page(struct gpmi_nand_data *this,
|
||||||
(struct scatterlist *)pio, 3,
|
(struct scatterlist *)pio, 3,
|
||||||
DMA_TRANS_NONE,
|
DMA_TRANS_NONE,
|
||||||
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
|
||||||
if (!desc) {
|
if (!desc)
|
||||||
pr_err("step 3 error\n");
|
return -EINVAL;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* [4] submit the DMA */
|
/* [4] submit the DMA */
|
||||||
set_dma_type(this, DMA_FOR_READ_ECC_PAGE);
|
set_dma_type(this, DMA_FOR_READ_ECC_PAGE);
|
||||||
|
|
Loading…
Reference in New Issue