summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/spi-nor/spi-nor.c
diff options
context:
space:
mode:
authorBrian Norris2015-08-14 00:46:05 +0200
committerBrian Norris2015-09-02 23:11:40 +0200
commit1976367173a47f801c67b5f456922d79c60d0d42 (patch)
tree55a67d031aa49b5a072201522b2e2153a76b62ad /drivers/mtd/spi-nor/spi-nor.c
parentmtd: spi-nor: add forward declaration for mtd_info (diff)
downloadkernel-qcow2-linux-1976367173a47f801c67b5f456922d79c60d0d42.tar.gz
kernel-qcow2-linux-1976367173a47f801c67b5f456922d79c60d0d42.tar.xz
kernel-qcow2-linux-1976367173a47f801c67b5f456922d79c60d0d42.zip
mtd: spi-nor: embed struct mtd_info within struct spi_nor
This reflects the proper layering, so let's do it. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Tested-by: Joachim Eastwood <manabian@gmail.com>
Diffstat (limited to 'drivers/mtd/spi-nor/spi-nor.c')
-rw-r--r--drivers/mtd/spi-nor/spi-nor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index d98180e73307..834a06049ca2 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -265,7 +265,7 @@ static int spi_nor_wait_till_ready(struct spi_nor *nor)
*/
static int erase_chip(struct spi_nor *nor)
{
- dev_dbg(nor->dev, " %lldKiB\n", (long long)(nor->mtd->size >> 10));
+ dev_dbg(nor->dev, " %lldKiB\n", (long long)(nor->mtd.size >> 10));
return nor->write_reg(nor, SPINOR_OP_CHIP_ERASE, NULL, 0, 0);
}
@@ -373,7 +373,7 @@ erase_err:
static int stm_lock(struct spi_nor *nor, loff_t ofs, uint64_t len)
{
- struct mtd_info *mtd = nor->mtd;
+ struct mtd_info *mtd = &nor->mtd;
uint32_t offset = ofs;
uint8_t status_old, status_new;
int ret = 0;
@@ -407,7 +407,7 @@ static int stm_lock(struct spi_nor *nor, loff_t ofs, uint64_t len)
static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len)
{
- struct mtd_info *mtd = nor->mtd;
+ struct mtd_info *mtd = &nor->mtd;
uint32_t offset = ofs;
uint8_t status_old, status_new;
int ret = 0;
@@ -1004,7 +1004,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
{
const struct flash_info *info = NULL;
struct device *dev = nor->dev;
- struct mtd_info *mtd = nor->mtd;
+ struct mtd_info *mtd = &nor->mtd;
struct device_node *np = dev->of_node;
int ret;
int i;