blob: 9c5a980fd53513e5962c2071d45b61c9e717f3e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
static int __devinit vain_plat_probe(struct platform_device *pdev)
{
struct vain_plat_info *info;
struct resource *res, *mem;
int err;
info = kzalloc(sizeof(struct vain_plat_info), GFP_KERNEL);
if (unlikely(!info)) {
dev_err(&pdev->dev, "Could not allocate memory\n");
err = -ENOMEM;
goto out;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (unlikely(!res)) {
dev_err(&pdev->dev, "I/O address already in use\n");
err = -ENOENT;
goto err_free;
}
mem = request_mem_region(res->start, resource_size(res), pdev->name);
if (!mem) {
err = -EBUSY;
goto err_free;
}
|