> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);What if you've not been given a resource ?Otherwise looks fine to me