diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2012-12-07 00:15:24 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-15 23:38:43 -0800 |
commit | e5279ff6c9f5e950feac6e6f48621db912324c07 (patch) | |
tree | 9c09cf2efa2269b31c3a4ae14f74dd47391a727a /drivers/mtd/mtdpart.c | |
parent | eea2172e6915a92cab1d3a79a4961e14a3c388ff (diff) |
drivers/w1/masters/mxc_w1.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches. This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
At the same time, this fixes two faults. First, mdev, the result of
kzalloc, was never freed. Second, on failure of ioremap, 0 was returned.
This has been replaced by -EBUSY, which was the failure value for the call
to request_mem_region, with which the call to ioremap has been combined.
The warning message on failure of ioremap is dropped, because
devm_request_and_ioremap already gives such messages on failure.
Finally, the initial call to platform_get_resource is moved closer to the
call to devm_request_and_ioremap, which takes care of checking whether its
result is NULL, implying that a test on the result of this call to
platform_get_resource is not needed.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mtd/mtdpart.c')
0 files changed, 0 insertions, 0 deletions