lkml.org 
[lkml]   [2020]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v11 12/14] mtd: spi-nor: core: expose spi_nor_default_setup() in core.h
    Date
    From: Pratyush Yadav <p.yadav@ti.com>

    Flashes might want to add a custom setup hook to configure the flash in
    the proper mode for operation. But after that, they would still want to
    run the default setup hook because it selects the read, program, and
    erase operations. Since there is little point in repeating all that
    code, expose the spi_nor_default_setup() in core.h to
    manufacturer-specific files.

    Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
    ---
    drivers/mtd/spi-nor/core.c | 4 ++--
    drivers/mtd/spi-nor/core.h | 3 +++
    2 files changed, 5 insertions(+), 2 deletions(-)

    diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
    index a263196d970f..5ebe0aed0871 100644
    --- a/drivers/mtd/spi-nor/core.c
    +++ b/drivers/mtd/spi-nor/core.c
    @@ -2740,8 +2740,8 @@ static int spi_nor_select_erase(struct spi_nor *nor)
    return 0;
    }

    -static int spi_nor_default_setup(struct spi_nor *nor,
    - const struct spi_nor_hwcaps *hwcaps)
    +int spi_nor_default_setup(struct spi_nor *nor,
    + const struct spi_nor_hwcaps *hwcaps)
    {
    struct spi_nor_flash_parameter *params = nor->params;
    u32 ignored_mask, shared_mask;
    diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
    index ec54ce6c5403..24cff27c51aa 100644
    --- a/drivers/mtd/spi-nor/core.h
    +++ b/drivers/mtd/spi-nor/core.h
    @@ -453,6 +453,9 @@ int spi_nor_post_bfpt_fixups(struct spi_nor *nor,
    const struct sfdp_bfpt *bfpt,
    struct spi_nor_flash_parameter *params);

    +int spi_nor_default_setup(struct spi_nor *nor,
    + const struct spi_nor_hwcaps *hwcaps);
    +
    static struct spi_nor __maybe_unused *mtd_to_spi_nor(struct mtd_info *mtd)
    {
    return mtd->priv;
    --
    2.27.0
    \
     
     \ /
      Last update: 2020-07-23 15:14    [W:3.721 / U:0.132 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site