]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: spi-nor: core: Use container_of to get the pointer to struct spi_nor
authorTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 29 Oct 2021 17:26:10 +0000 (20:26 +0300)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Wed, 17 Nov 2021 12:36:01 +0000 (14:36 +0200)
commit5981d35e3c1c0c0b1f3662380eda7fcfca787f33
tree64adc7d3dcf807ae1d1b95e1e32d8496288b98d2
parent741300656b30a6e3ce8cde1e4387492767b510ed
mtd: spi-nor: core: Use container_of to get the pointer to struct spi_nor

"struct mtd_info mtd" is member of "struct spi_nor", there's no need
to use "mtd->priv". Get the pointer to the containing struct spi_nor
by using container_of. While here, make the function inline and
get rid of the __maybe_unused.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/20211029172633.886453-3-tudor.ambarus@microchip.com
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/core.h