projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mtd: spi-nor: Zap unneeded write_enable from write_reg
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
mtd
/
spi-nor
/
fsl-quadspi.c
diff --git
a/drivers/mtd/spi-nor/fsl-quadspi.c
b/drivers/mtd/spi-nor/fsl-quadspi.c
index ad9f73ae6eea167975b6350bfc69c937dbb13eb1..2954f89fc8be9af420d681c90e87b7bcd052baf8 100644
(file)
--- a/
drivers/mtd/spi-nor/fsl-quadspi.c
+++ b/
drivers/mtd/spi-nor/fsl-quadspi.c
@@
-259,7
+259,6
@@
static struct fsl_qspi_devtype_data imx6ul_data = {
#define FSL_QSPI_MAX_CHIP 4
struct fsl_qspi {
#define FSL_QSPI_MAX_CHIP 4
struct fsl_qspi {
- struct mtd_info mtd[FSL_QSPI_MAX_CHIP];
struct spi_nor nor[FSL_QSPI_MAX_CHIP];
void __iomem *iobase;
void __iomem *ahb_addr;
struct spi_nor nor[FSL_QSPI_MAX_CHIP];
void __iomem *iobase;
void __iomem *ahb_addr;
@@
-798,8
+797,7
@@
static int fsl_qspi_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
return 0;
}
return 0;
}
-static int fsl_qspi_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len,
- int write_enable)
+static int fsl_qspi_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
{
struct fsl_qspi *q = nor->priv;
int ret;
{
struct fsl_qspi *q = nor->priv;
int ret;
@@
-888,7
+886,7
@@
static int fsl_qspi_erase(struct spi_nor *nor, loff_t offs)
int ret;
dev_dbg(nor->dev, "%dKiB at 0x%08x:0x%08x\n",
int ret;
dev_dbg(nor->dev, "%dKiB at 0x%08x:0x%08x\n",
- nor->mtd
->
erasesize / 1024, q->chip_base_addr, (u32)offs);
+ nor->mtd
.
erasesize / 1024, q->chip_base_addr, (u32)offs);
ret = fsl_qspi_runcmd(q, nor->erase_opcode, offs, 0);
if (ret)
ret = fsl_qspi_runcmd(q, nor->erase_opcode, offs, 0);
if (ret)
@@
-1006,17
+1004,15
@@
static int fsl_qspi_probe(struct platform_device *pdev)
/* iterate the subnodes. */
for_each_available_child_of_node(dev->of_node, np) {
/* iterate the subnodes. */
for_each_available_child_of_node(dev->of_node, np) {
- char modalias[40];
-
/* skip the holes */
if (!q->has_second_chip)
i *= 2;
nor = &q->nor[i];
/* skip the holes */
if (!q->has_second_chip)
i *= 2;
nor = &q->nor[i];
- mtd = &
q->mtd[i]
;
+ mtd = &
nor->mtd
;
- nor->mtd = mtd;
nor->dev = dev;
nor->dev = dev;
+ nor->flash_node = np;
nor->priv = q;
/* fill the hooks */
nor->priv = q;
/* fill the hooks */
@@
-1029,10
+1025,6
@@
static int fsl_qspi_probe(struct platform_device *pdev)
nor->prepare = fsl_qspi_prep;
nor->unprepare = fsl_qspi_unprep;
nor->prepare = fsl_qspi_prep;
nor->unprepare = fsl_qspi_unprep;
- ret = of_modalias_node(np, modalias, sizeof(modalias));
- if (ret < 0)
- goto mutex_failed;
-
ret = of_property_read_u32(np, "spi-max-frequency",
&q->clk_rate);
if (ret < 0)
ret = of_property_read_u32(np, "spi-max-frequency",
&q->clk_rate);
if (ret < 0)
@@
-1041,7
+1033,7
@@
static int fsl_qspi_probe(struct platform_device *pdev)
/* set the chip address for READID */
fsl_qspi_set_base_addr(q, nor);
/* set the chip address for READID */
fsl_qspi_set_base_addr(q, nor);
- ret = spi_nor_scan(nor,
modalias
, SPI_NOR_QUAD);
+ ret = spi_nor_scan(nor,
NULL
, SPI_NOR_QUAD);
if (ret)
goto mutex_failed;
if (ret)
goto mutex_failed;
@@
-1086,7
+1078,7
@@
last_init_failed:
/* skip the holes */
if (!q->has_second_chip)
i *= 2;
/* skip the holes */
if (!q->has_second_chip)
i *= 2;
- mtd_device_unregister(&q->
mtd[i]
);
+ mtd_device_unregister(&q->
nor[i].mtd
);
}
mutex_failed:
mutex_destroy(&q->lock);
}
mutex_failed:
mutex_destroy(&q->lock);
@@
-1106,7
+1098,7
@@
static int fsl_qspi_remove(struct platform_device *pdev)
/* skip the holes */
if (!q->has_second_chip)
i *= 2;
/* skip the holes */
if (!q->has_second_chip)
i *= 2;
- mtd_device_unregister(&q->
mtd[i]
);
+ mtd_device_unregister(&q->
nor[i].mtd
);
}
/* disable the hardware */
}
/* disable the hardware */