···243243int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)244244{245245 struct resource *res;246246- struct resource temp_res;247246248247 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wp");249248 if (!res) {250250- DSSDBG("can't get WP mem resource by name\n");251251- /*252252- * if hwmod/DT doesn't have the memory resource information253253- * split into HDMI sub blocks by name, we try again by getting254254- * the platform's first resource. this code will be removed when255255- * the driver can get the mem resources by name256256- */257257- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);258258- if (!res) {259259- DSSERR("can't get WP mem resource\n");260260- return -EINVAL;261261- }262262-263263- temp_res.start = res->start;264264- temp_res.end = temp_res.start + WP_SIZE - 1;265265- res = &temp_res;249249+ DSSERR("can't get WP mem resource\n");250250+ return -EINVAL;266251 }267252268268- wp->base = devm_ioremap(&pdev->dev, res->start, resource_size(res));253253+ wp->base = devm_ioremap_resource(&pdev->dev, res);269254 if (!wp->base) {270255 DSSERR("can't ioremap HDMI WP\n");271256 return -ENOMEM;