Commit 0ec544ce authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: npcm-fiu: Reuse BITS_PER_BYTE definition

No need to redefine already existing definition.
So, replace custom by generic one.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200618170144.57433-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 539afdf9
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2019 Nuvoton Technology corporation. // Copyright (c) 2019 Nuvoton Technology corporation.
#include <linux/bits.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/device.h> #include <linux/device.h>
...@@ -177,7 +178,6 @@ enum { ...@@ -177,7 +178,6 @@ enum {
#define MAP_SIZE_16MB 0x1000000 #define MAP_SIZE_16MB 0x1000000
#define MAP_SIZE_8MB 0x800000 #define MAP_SIZE_8MB 0x800000
#define NUM_BITS_IN_BYTE 8
#define FIU_DRD_MAX_DUMMY_NUMBER 3 #define FIU_DRD_MAX_DUMMY_NUMBER 3
#define NPCM_MAX_CHIP_NUM 4 #define NPCM_MAX_CHIP_NUM 4
#define CHUNK_SIZE 16 #define CHUNK_SIZE 16
...@@ -252,8 +252,8 @@ static void npcm_fiu_set_drd(struct npcm_fiu_spi *fiu, ...@@ -252,8 +252,8 @@ static void npcm_fiu_set_drd(struct npcm_fiu_spi *fiu,
fiu->drd_op.addr.buswidth = op->addr.buswidth; fiu->drd_op.addr.buswidth = op->addr.buswidth;
regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG, regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG,
NPCM_FIU_DRD_CFG_DBW, NPCM_FIU_DRD_CFG_DBW,
((op->dummy.nbytes * ilog2(op->addr.buswidth)) ((op->dummy.nbytes * ilog2(op->addr.buswidth)) / BITS_PER_BYTE)
/ NUM_BITS_IN_BYTE) << NPCM_FIU_DRD_DBW_SHIFT); << NPCM_FIU_DRD_DBW_SHIFT);
fiu->drd_op.dummy.nbytes = op->dummy.nbytes; fiu->drd_op.dummy.nbytes = op->dummy.nbytes;
regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG, regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG,
NPCM_FIU_DRD_CFG_RDCMD, op->cmd.opcode); NPCM_FIU_DRD_CFG_RDCMD, op->cmd.opcode);
......
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