devres: remove devm_request_and_ioremap()

devm_request_and_ioremap() was obsoleted by the commit 7509657
("lib: devres: Introduce devm_ioremap_resource()") and has been
deprecated for a long time. So, let's remove this function.
In addition, all usages of devm_request_and_ioremap() are also
removed.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jingoo Han 2014-06-11 14:00:05 +09:00 committed by Greg Kroah-Hartman
parent 7171511eae
commit c9d53c0f2d
6 changed files with 6 additions and 129 deletions

View File

@ -278,7 +278,6 @@ IOMAP
devm_ioremap_nocache()
devm_iounmap()
devm_ioremap_resource() : checks resource, requests memory region, ioremaps
devm_request_and_ioremap() : obsoleted by devm_ioremap_resource()
pcim_iomap()
pcim_iounmap()
pcim_iomap_table() : array of mapped addresses indexed by BAR

View File

@ -212,9 +212,9 @@ static int brcmstb_gisb_arb_probe(struct platform_device *pdev)
mutex_init(&gdev->lock);
INIT_LIST_HEAD(&gdev->next);
gdev->base = devm_request_and_ioremap(&pdev->dev, r);
if (!gdev->base)
return -ENOMEM;
gdev->base = devm_ioremap_resource(&pdev->dev, r);
if (IS_ERR(gdev->base))
return PTR_ERR(gdev->base);
err = devm_request_irq(&pdev->dev, timeout_irq,
brcmstb_gisb_timeout_handler, 0, pdev->name,

View File

@ -1039,11 +1039,9 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
if (ret)
return ret;
base = devm_request_and_ioremap(dev->dev, res);
if (!base) {
DRM_ERROR("failed to ioremap register\n");
return -ENOMEM;
}
base = devm_ioremap_resource(dev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
dcrtc = kzalloc(sizeof(*dcrtc), GFP_KERNEL);
if (!dcrtc) {

View File

@ -631,8 +631,6 @@ extern unsigned long devm_get_free_pages(struct device *dev,
extern void devm_free_pages(struct device *dev, unsigned long addr);
void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res);
void __iomem *devm_request_and_ioremap(struct device *dev,
struct resource *res);
/* allows to add/remove a custom action to devres stack */
int devm_add_action(struct device *dev, void (*action)(void *), void *data);

View File

@ -142,34 +142,6 @@ void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res)
}
EXPORT_SYMBOL(devm_ioremap_resource);
/**
* devm_request_and_ioremap() - Check, request region, and ioremap resource
* @dev: Generic device to handle the resource for
* @res: resource to be handled
*
* Takes all necessary steps to ioremap a mem resource. Uses managed device, so
* everything is undone on driver detach. Checks arguments, so you can feed
* it the result from e.g. platform_get_resource() directly. Returns the
* remapped pointer or NULL on error. Usage example:
*
* res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
* base = devm_request_and_ioremap(&pdev->dev, res);
* if (!base)
* return -EADDRNOTAVAIL;
*/
void __iomem *devm_request_and_ioremap(struct device *dev,
struct resource *res)
{
void __iomem *dest_ptr;
dest_ptr = devm_ioremap_resource(dev, res);
if (IS_ERR(dest_ptr))
return NULL;
return dest_ptr;
}
EXPORT_SYMBOL(devm_request_and_ioremap);
#ifdef CONFIG_HAS_IOPORT_MAP
/*
* Generic iomap devres

View File

@ -1,90 +0,0 @@
virtual patch
virtual report
@depends on patch@
expression base, dev, res;
@@
-base = devm_request_and_ioremap(dev, res);
+base = devm_ioremap_resource(dev, res);
...
if (
-base == NULL
+IS_ERR(base)
|| ...) {
<...
- return ...;
+ return PTR_ERR(base);
...>
}
@depends on patch@
expression e, E, ret;
identifier l;
@@
e = devm_ioremap_resource(...);
...
if (IS_ERR(e) || ...) {
... when any
- ret = E;
+ ret = PTR_ERR(e);
...
(
return ret;
|
goto l;
)
}
@depends on patch@
expression e;
@@
e = devm_ioremap_resource(...);
...
if (IS_ERR(e) || ...) {
...
- \(dev_dbg\|dev_err\|pr_debug\|pr_err\|DRM_ERROR\)(...);
...
}
@depends on patch@
expression e;
identifier l;
@@
e = devm_ioremap_resource(...);
...
if (IS_ERR(e) || ...)
-{
(
return ...;
|
goto l;
)
-}
@r depends on report@
expression e;
identifier l;
position p1;
@@
*e = devm_request_and_ioremap@p1(...);
...
if (e == NULL || ...) {
...
(
return ...;
|
goto l;
)
}
@script:python depends on r@
p1 << r.p1;
@@
msg = "ERROR: deprecated devm_request_and_ioremap() API used on line %s" % (p1[0].line)
coccilib.report.print_report(p1[0], msg)