mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
auxdisplay: img-ascii-lcd: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
This commit is contained in:
@@ -356,7 +356,6 @@ static int img_ascii_lcd_probe(struct platform_device *pdev)
|
|||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
const struct img_ascii_lcd_config *cfg;
|
const struct img_ascii_lcd_config *cfg;
|
||||||
struct img_ascii_lcd_ctx *ctx;
|
struct img_ascii_lcd_ctx *ctx;
|
||||||
struct resource *res;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
match = of_match_device(img_ascii_lcd_matches, &pdev->dev);
|
match = of_match_device(img_ascii_lcd_matches, &pdev->dev);
|
||||||
@@ -378,8 +377,7 @@ static int img_ascii_lcd_probe(struct platform_device *pdev)
|
|||||||
&ctx->offset))
|
&ctx->offset))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else {
|
} else {
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
ctx->base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
ctx->base = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(ctx->base))
|
if (IS_ERR(ctx->base))
|
||||||
return PTR_ERR(ctx->base);
|
return PTR_ERR(ctx->base);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user