Skip to content

Commit

Permalink
devres: remove devm_request_and_ioremap()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Jingoo Han authored and gregkh committed Jun 20, 2014
1 parent 7171511 commit c9d53c0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 129 deletions.
1 change: 0 additions & 1 deletion Documentation/driver-model/devres.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions drivers/bus/brcmstb_gisb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions drivers/gpu/drm/armada/armada_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
28 changes: 0 additions & 28 deletions lib/devres.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
90 changes: 0 additions & 90 deletions scripts/coccinelle/api/devm_ioremap_resource.cocci

This file was deleted.

0 comments on commit c9d53c0

Please sign in to comment.