linux_dsm_epyc7002/drivers/mtd/nand
Michael Opdenacker a0fa0b66ac mtd: orion_nand: fix error code path in probe
This replaces kzalloc() and ioremap() calls by devm_ functions
in the probe() routine, which automatically release the corresponding
resources when probe() fails or when the device is removed.

This simplifies simplifies the error management code, and brings
the below improvements or changes:

A. Fixing a bug reported by "make coccicheck":

If "board = devm_kzalloc()" fails, the probe() function jumps
incorrectly to label "no_res" and therefore returns without
running iounmap().

B. Requesting the memory region

Using devm_ioremap_resource() makes the probe() function request
the corresponding memory region before running ioremap(), as
it is supposed to do.

C. Standardizing the error codes:

The use of devm_ioremap_resource() changes the return value:
 * -ENOMEM instead of -EIO in case of ioremap() failure,
 * -EINVAL instead of -ENODEV in case of platform_get_resource()
   failure.

Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-10-22 01:35:41 -07:00
..
bcm47xxnflash mtd: bcm47xxnflash: replace some magic numbers 2014-09-17 23:25:03 -07:00
gpmi-nand
ams-delta.c
atmel_nand_ecc.h
atmel_nand_nfc.h
atmel_nand.c mtd: atmel_nand: remove pmecc_bytes_per_sector, use chip->ecc.bytes instead 2014-09-17 23:05:11 -07:00
au1550nd.c
bf5xx_nand.c
cafe_nand.c
cmx270_nand.c
cs553x_nand.c
davinci_nand.c
denali_dt.c
denali_pci.c
denali.c mtd: denali: fix indents and other trivial things 2014-09-19 09:39:27 -07:00
denali.h mtd: denali: fix include guard and license block of denali.h 2014-09-17 23:32:30 -07:00
diskonchip.c
docg4.c
fsl_elbc_nand.c
fsl_ifc_nand.c
fsl_upm.c
fsmc_nand.c mtd: fsmc_nand: use dmaengine_terminate_all() API 2014-10-15 21:30:59 +05:30
gpio.c
jz4740_nand.c
Kconfig mtd: nand: omap: Correct CONFIG_MTD_NAND_OMAP_BCH help message 2014-10-06 23:40:09 -07:00
lpc32xx_mlc.c
lpc32xx_slc.c
Makefile mtd: nand: Force omap_elm to be built as a module if omap2_nand is a module 2014-10-06 23:40:07 -07:00
mpc5121_nfc.c
mxc_nand.c
nand_base.c mtd: nand: support ONFI timing mode retrieval for non-ONFI NANDs 2014-09-22 11:29:57 -07:00
nand_bbt.c mtd: nand: don't break long print messages 2014-09-17 23:29:36 -07:00
nand_bch.c
nand_ecc.c
nand_ids.c mtd: nand: add Hynix's H27UCG8T2ATR-BC to nand_ids table 2014-09-22 11:31:40 -07:00
nand_timings.c mtd: nand: Use ULL-suffix for big u64 constant 2014-08-19 11:53:09 -07:00
nandsim.c mtd: nandsim: fix integer widening 2014-08-19 11:53:08 -07:00
ndfc.c
nuc900_nand.c
omap2.c mtd: nand: omap: Do not use global variables 2014-10-22 01:33:33 -07:00
omap_elm.c mtd: nand: Move ELM driver and rename as omap_elm 2014-09-22 11:39:26 -07:00
orion_nand.c mtd: orion_nand: fix error code path in probe 2014-10-22 01:35:41 -07:00
pasemi_nand.c
plat_nand.c
pxa3xx_nand.c
r852.c
r852.h
s3c2410.c
sh_flctl.c mtd: sh_flctl: use dmaengine_terminate_all() API 2014-10-15 21:30:59 +05:30
sharpsl.c
sm_common.c
sm_common.h
socrates_nand.c
tmio_nand.c
txx9ndfmc.c
xway_nand.c