tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-next head: 75096579c3ac39ddc2f8b0d9a8924eba31f4d920 commit: 75096579c3ac39ddc2f8b0d9a8924eba31f4d920 lib: devres: Introduce devm_ioremap_resource() date: 3 hours ago config: make ARCH=openrisc or1ksim_defconfig All error/warnings: lib/devres.c: In function 'devm_ioremap_resource': >> lib/devres.c:116:3: error: implicit declaration of function 'ERR_PTR' >> lib/devres.c:116:3: warning: return makes pointer from integer without a cast lib/devres.c:124:3: warning: return makes pointer from integer without a cast >> lib/devres.c:135:12: warning: assignment makes pointer from integer without a cast lib/devres.c: In function 'devm_request_and_ioremap': >> lib/devres.c:163:2: error: implicit declaration of function 'IS_ERR' vim +/ERR_PTR +116 lib/devres.c 110 void __iomem *dest_ptr; 111 112 BUG_ON(!dev); 113 114 if (!res || resource_type(res) != IORESOURCE_MEM) { 115 dev_err(dev, "invalid resource\n"); > 116 return ERR_PTR(-EINVAL); 117 } 118 119 size = resource_size(res); 120 name = res->name ?: dev_name(dev); 121 122 if (!devm_request_mem_region(dev, res->start, size, name)) { 123 dev_err(dev, "can't request region for resource %pR\n", res); 124 return ERR_PTR(-EBUSY); 125 } 126 127 if (res->flags & IORESOURCE_CACHEABLE) 128 dest_ptr = devm_ioremap(dev, res->start, size); 129 else 130 dest_ptr = devm_ioremap_nocache(dev, res->start, size); 131 132 if (!dest_ptr) { 133 dev_err(dev, "ioremap failed for resource %pR\n", res); 134 devm_release_mem_region(dev, res->start, size); 135 dest_ptr = ERR_PTR(-ENOMEM); 136 } 137 138 return dest_ptr; 139 } 140 EXPORT_SYMBOL(devm_ioremap_resource); 141 142 /** 143 * devm_request_and_ioremap() - Check, request region, and ioremap resource 144 * @dev: Generic device to handle the resource for 145 * @res: resource to be handled 146 * 147 * Takes all necessary steps to ioremap a mem resource. Uses managed device, so 148 * everything is undone on driver detach. Checks arguments, so you can feed 149 * it the result from e.g. platform_get_resource() directly. Returns the 150 * remapped pointer or NULL on error. Usage example: 151 * 152 * res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 153 * base = devm_request_and_ioremap(&pdev->dev, res); 154 * if (!base) 155 * return -EADDRNOTAVAIL; 156 */ 157 void __iomem *devm_request_and_ioremap(struct device *device, 158 struct resource *res) 159 { 160 void __iomem *dest_ptr; 161 162 dest_ptr = devm_ioremap_resource(device, res); 163 if (IS_ERR(dest_ptr)) 164 return NULL; 165 166 return dest_ptr; --- 0-DAY kernel build testing backend Open Source Technology Center http://lists.01.org/mailman/listinfo/kbuild Intel Corporation _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel