lkml.org 
[lkml]   [2019]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/5] staging: kpc2000: kpc_spi: use devm_* API to manage mapped I/O space
Date
The kpc_spi driver does not unmap its I/O space upon error cases in the
probe() function or upon remove(). Make the driver clean up after itself
more maintainably by migrating to using the managed resource API.

Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
---
drivers/staging/kpc2000/kpc2000_spi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c
index b513432a26ed..32d3ec532e26 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -471,7 +471,8 @@ kp_spi_probe(struct platform_device *pldev)
goto free_master;
}

- kpspi->phys = (unsigned long)ioremap_nocache(r->start, resource_size(r));
+ kpspi->phys = (unsigned long)devm_ioremap_nocache(&pldev->dev, r->start,
+ resource_size(r));
kpspi->base = (u64 __iomem *)kpspi->phys;

status = spi_register_master(master);
--
2.21.0
\
 
 \ /
  Last update: 2019-06-02 18:00    [W:0.079 / U:6.392 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site