From fe7855bb4f2d82ac4559c46c586c2f29e9f123e2 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 18 Feb 2016 11:01:59 +0100 Subject: driver: Introduce dev_request_mem_resource dev_request_mem_region returns a void * which shall be checked with IS_ERR(), but in some cases the valid pointer returned clashes with error values. This is especially the case on some Atmel SoCs. This introduces dev_request_mem_resource which returns a struct resource instead which in any case can be checked with IS_ERR(). It's the drivers responsibility then to get the IOMEM pointer from the resource. Signed-off-by: Sascha Hauer --- include/driver.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/driver.h') diff --git a/include/driver.h b/include/driver.h index 31c673452f..5e2b88f315 100644 --- a/include/driver.h +++ b/include/driver.h @@ -203,9 +203,15 @@ void *dev_get_mem_region(struct device_d *dev, int num); /* * exlusively request register base 'num' for a device + * deprecated, use dev_request_mem_resource instead */ void __iomem *dev_request_mem_region(struct device_d *dev, int num); +/* + * exlusively request resource 'num' for a device + */ +struct resource *dev_request_mem_resource(struct device_d *dev, int num); + /* * exlusively request register base 'num' for a device * will return NULL on error -- cgit v1.2.3