OSDN Git Service

mtd: nand: denali: clean up macros with <linux/bitfield.h>
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 22 Sep 2017 03:46:43 +0000 (12:46 +0900)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 22 Sep 2017 07:04:25 +0000 (09:04 +0200)
commite0d53b3f8ed2b14dab54a04a4589fa72b0827fa5
tree9c0bcc950bac885b08c6e135a8b28980f0c224f2
parentfdd4d0836bdb0dd6a4e7e588d7dce2de37f8531d
mtd: nand: denali: clean up macros with <linux/bitfield.h>

All the register offsets and bitfield masks are defined in denali.h,
but the driver code ended up with additional crappy macros such as
MAKE_ECC_CORRECTION(), ECC_SECTOR(), etc.

The reason is apparent - accessing a register field requires mask and
shift pair.  The denali.h only provides mask.  However, defining both
is tedious.

<linux/bitfield.h> provides a convenient way to get register fields
only with a single shifted mask.  Now use it.

While I am here, I shortened some macros.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/denali.c
drivers/mtd/nand/denali.h