Thierry Reding
75096579c3
lib: devres: Introduce devm_ioremap_resource()
...
The devm_request_and_ioremap() function is very useful and helps avoid a
whole lot of boilerplate. However, one issue that keeps popping up is
its lack of a specific error code to determine which of the steps that
it performs failed. Furthermore, while the function gives an example and
suggests what error code to return on failure, a wide variety of error
codes are used throughout the tree.
In an attempt to fix these problems, this patch adds a new function that
drivers can transition to. The devm_ioremap_resource() returns a pointer
to the remapped I/O memory on success or an ERR_PTR() encoded error code
on failure. Callers can check for failure using IS_ERR() and determine
its cause by extracting the error code using PTR_ERR().
devm_request_and_ioremap() is implemented as a wrapper around the new
API and return NULL on failure as before. This ensures that backwards
compatibility is maintained until all users have been converted to the
new API, at which point the old devm_request_and_ioremap() function
should be removed.
A semantic patch is included which can be used to convert from the old
devm_request_and_ioremap() API to the new devm_ioremap_resource() API.
Some non-trivial cases may require manual intervention, though.
Signed-off-by: Thierry Reding <[email protected] >
Cc: Arnd Bergmann <[email protected] >
Acked-by: Dmitry Torokhov <[email protected] >
Signed-off-by: Greg Kroah-Hartman <[email protected] >
2013-01-22 09:41:43 -08:00
..
basic
coccinelle
lib: devres: Introduce devm_ioremap_resource()
2013-01-22 09:41:43 -08:00
dtc
script: dtc: clean generated files
2012-11-21 15:53:22 +00:00
genksyms
scripts/genksyms: clean lex/yacc generated files
2012-01-08 14:48:15 +01:00
kconfig
menuconfig: Replace CIRCLEQ by list_head-style lists.
2012-10-25 15:06:00 +02:00
ksymoops
mod
modpost.c: Stop checking __dev* section mismatches
2012-11-30 12:08:42 -08:00
package
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
2012-10-12 10:27:27 +09:00
rt-tester
selinux
tracing
.gitignore
X.509: Add simple ASN.1 grammar compiler
2012-10-08 13:50:19 +10:30
asn1_compiler.c
X.509: Add simple ASN.1 grammar compiler
2012-10-08 13:50:19 +10:30
bin2c.c
bloat-o-meter
bootgraph.pl
checkincludes.pl
checkkconfigsymbols.sh
checkpatch.pl
checkpatch: warn on uapi #includes that #include <uapi/...
2012-12-20 17:40:20 -08:00
checkstack.pl
checksyscalls.sh
checksyscalls: fix "here document" handling
2012-09-25 08:59:21 -07:00
checkversion.pl
cleanfile
cleanpatch
coccicheck
coccicheck: Add the rep+ctxt mode
2012-10-11 15:11:12 +02:00
config
scripts/config: Fix wrong "shift" for --keep-case
2012-12-14 14:16:10 +01:00
conmakehash.c
decodecode
scripts/decodecode: Fixup trapping instruction marker
2012-08-16 11:15:09 -07:00
depmod.sh
kbuild: do not check for ancient modutils tools
2012-01-23 15:12:19 +01:00
diffconfig
docproc.c
export_report.pl
extract-ikconfig
extract-vmlinux
gcc-goto.sh
ARM: 7333/2: jump label: detect %c support for ARM
2012-03-24 09:38:56 +00:00
gcc-version.sh
kbuild: Fix gcc -x syntax
2012-10-03 09:03:24 +02:00
gcc-x86_32-has-stack-protector.sh
kbuild: Fix gcc -x syntax
2012-10-03 09:03:24 +02:00
gcc-x86_64-has-stack-protector.sh
kbuild: Fix gcc -x syntax
2012-10-03 09:03:24 +02:00
gen_initramfs_list.sh
get_maintainer.pl
get_maintainer: Fix --help warning
2012-06-20 14:39:36 -07:00
gfp-translate
chmod +x scripts/gfp-translate
2012-06-27 12:44:29 -07:00
headerdep.pl
headers.sh
kbuild, headers.sh: Don't make archheaders explicitly
2011-11-22 14:47:50 -08:00
headers_check.pl
headers_check: recursively search for linux/types.h inclusion
2012-03-26 14:54:27 +02:00
headers_install.pl
UAPI: Strip _UAPI prefix on header install no matter the whitespace
2013-01-02 17:36:10 -08:00
kallsyms.c
Kbuild.include
Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
2012-10-08 07:56:10 +09:00
kernel-doc
misc: remove __dev* attributes.
2013-01-03 15:57:16 -08:00
Lindent
link-vmlinux.sh
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lliubbo/blackfin
2012-09-12 07:12:53 +08:00
Makefile
X.509: Add simple ASN.1 grammar compiler
2012-10-08 13:50:19 +10:30
Makefile.asm-generic
uapi: Allow automatic generation of uapi/asm/ header files
2012-10-17 12:25:44 +01:00
Makefile.build
X.509: Add simple ASN.1 grammar compiler
2012-10-08 13:50:19 +10:30
Makefile.clean
Makefile.fwinst
kbuild: Fix accidental revert in commit fe04ddf
2012-10-15 13:01:05 -07:00
Makefile.headersinst
UAPI: Plumb the UAPI Kbuilds into the user header installation and checking
2012-10-02 18:01:57 +01:00
Makefile.help
Makefile.host
Makefile.lib
kbuild: centralize .dts->.dtb rule
2012-11-30 10:52:19 -06:00
Makefile.modbuiltin
Makefile.modinst
modules: don't break modules_install on external modules with no key.
2012-11-06 11:52:24 +10:30
Makefile.modpost
kbuild: sign the modules at install time
2012-10-19 08:27:43 -07:00
Makefile.modsign
MODSIGN: Add modules_sign make target
2012-12-14 13:05:28 +10:30
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
trivial: typo in comment in mksysmap
2012-07-20 10:36:05 +02:00
mkuboot.sh
mkversion
module-common.lds
namespace.pl
patch-kernel
scripts/patch-kernel: digest kernel.org hosted .xz patches
2012-03-30 15:23:36 +02:00
pnmtologo.c
scripts/pnmtologo: fix for plain PBM
2012-11-20 11:58:03 +01:00
profile2linkerlist.pl
recordmcount.c
recordmcount.h
ftrace: Make recordmcount.c handle __fentry__
2012-08-23 11:24:43 -04:00
recordmcount.pl
setlocalversion
setlocalversion: Use "grep -q" instead of piping output to "read dummy"
2012-03-26 22:54:00 +02:00
show_delta
sign-file
sign-file: fix the perl warning message when extracting ASN.1
2012-11-21 06:52:12 -10:00
sortextable.c
ARM: 7568/1: Sort exception table at compile time
2012-11-04 10:31:16 +00:00
sortextable.h
scripts/sortextable: Handle relative entries, and other cleanups
2012-04-24 11:42:20 -07:00
tags.sh
scripts/tags.sh: Support compiled source
2012-12-11 14:25:42 +01:00
unifdef.c
ver_linux
xz_wrap.sh
xz: Enable BCJ filters on SPARC and 32-bit x86
2012-04-18 13:13:18 -07:00