函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\devres.c Create Date:2022-07-27 07:46:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__devm_ioremap_resource

函数原型:static void __iomem *__devm_ioremap_resource(struct device *dev, const struct resource *res, enum devm_ioremap_type type)

返回类型:void

参数:

类型参数名称
struct device *dev
const struct resource *res
enum devm_ioremap_typetype
141  __iomemdest_ptr
143  BUG_ON(!dev)
145  如果非resresource_type(res)不等于IORESOURCE_MEM
146  dev_err(dev, "invalid resource\n")
147  返回:IOMEM_ERR_PTR( - EINVAL)
150  size等于resource_size(res)
152  如果非devm_request_mem_region(dev, start, size, dev_name(dev))则
153  dev_err(dev, "can't request region for resource %pR\n", res)
154  返回:IOMEM_ERR_PTR( - EBUSY)
157  dest_ptr等于__devm_ioremap(dev, start, size, type)
158  如果非dest_ptr
159  dev_err(dev, "ioremap failed for resource %pR\n", res)
160  devm_release_mem_region(dev, start, size)
161  dest_ptr等于IOMEM_ERR_PTR( - ENOMEM)
164  返回:dest_ptr
调用者
名称描述
devm_ioremap_resourcedevm_ioremap_resource() - check, request region, and ioremap resource*@dev: generic device to handle the resource for*@res: resource to be handled* Checks that a resource is a valid memory region, requests the memory* region and ioremaps it
devm_ioremap_resource_wcdevm_ioremap_resource_wc() - write-combined variant of* devm_ioremap_resource()*@dev: generic device to handle the resource for*@res: resource to be handled* Returns a pointer to the remapped memory or an ERR_PTR() encoded error code* on failure