Commit c96ffedf authored by Martin Blumenstingl's avatar Martin Blumenstingl Committed by Miquel Raynal

mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup

This simplifies the code because it gets rid of the casts to an
u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip.
Also it gets rid of the cast of the u8 databuf pointer to a void
pointer.
The logic inside meson_nfc_dma_buffer_setup() doesn't care about the
pointer types themselves because it only passes them to dma_map_single
which accepts a void pointer.

No functional changes.
Signed-off-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: default avatarLiang Yang <liang.yang@amlogic.com>
Acked-by: default avatarLiang Yang <liang.yang@amlogic.com>
Tested-by: default avatarLiang Yang <liang.yang@amlogic.com>
Acked-by: default avatarLiang Yang <liang.yang@amlogic.com>
Tested-by: default avatarLiang Yang <liang.yang@amlogic.com>
Acked-by: default avatarLiang Yang <liang.yang@amlogic.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 2d8ffbf5
...@@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, ...@@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips,
return ret; return ret;
} }
static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf,
int datalen, u8 *infobuf, int infolen, int datalen, void *infobuf, int infolen,
enum dma_data_direction dir) enum dma_data_direction dir)
{ {
struct meson_nfc *nfc = nand_get_controller_data(nand); struct meson_nfc *nfc = nand_get_controller_data(nand);
u32 cmd; u32 cmd;
int ret = 0; int ret = 0;
nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir);
ret = dma_mapping_error(nfc->dev, nfc->daddr); ret = dma_mapping_error(nfc->dev, nfc->daddr);
if (ret) { if (ret) {
dev_err(nfc->dev, "DMA mapping error\n"); dev_err(nfc->dev, "DMA mapping error\n");
...@@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, ...@@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand,
return ret; return ret;
ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf,
data_len, (u8 *)meson_chip->info_buf, data_len, meson_chip->info_buf,
info_len, DMA_TO_DEVICE); info_len, DMA_TO_DEVICE);
if (ret) if (ret)
return ret; return ret;
...@@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, ...@@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand,
return ret; return ret;
ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf,
data_len, (u8 *)meson_chip->info_buf, data_len, meson_chip->info_buf,
info_len, DMA_FROM_DEVICE); info_len, DMA_FROM_DEVICE);
if (ret) if (ret)
return ret; return ret;
......
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