Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b22622f0 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen
Browse files

drm: omapdrm: Remove duplicate error messages when mapping memory



The devm_ioremap_resource() call can handle being given a NULL resource,
and prints an error message when mapping fails. Switch the remaining
devm_ioremap() calls to devm_ioremap_resource() and remove all
extraneous resource NULL checks and error messages printed manually by
the driver.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent c488dd20
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -4405,17 +4405,9 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)
		return r;

	dispc_mem = platform_get_resource(dispc.pdev, IORESOURCE_MEM, 0);
	if (!dispc_mem) {
		DSSERR("can't get IORESOURCE_MEM DISPC\n");
		return -EINVAL;
	}

	dispc.base = devm_ioremap(&pdev->dev, dispc_mem->start,
				  resource_size(dispc_mem));
	if (!dispc.base) {
		DSSERR("can't ioremap DISPC\n");
		return -ENOMEM;
	}
	dispc.base = devm_ioremap_resource(&pdev->dev, dispc_mem);
	if (IS_ERR(dispc.base))
		return PTR_ERR(dispc.base);

	dispc.irq = platform_get_irq(dispc.pdev, 0);
	if (dispc.irq < 0) {
+9 −18
Original line number Diff line number Diff line
@@ -5326,12 +5326,9 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)

	dsi_mem = res;

	dsi->proto_base = devm_ioremap(&dsidev->dev, res->start,
		resource_size(res));
	if (!dsi->proto_base) {
		DSSERR("can't ioremap DSI protocol engine\n");
		return -ENOMEM;
	}
	dsi->proto_base = devm_ioremap_resource(&dsidev->dev, res);
	if (IS_ERR(dsi->proto_base))
		return PTR_ERR(dsi->proto_base);

	res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "phy");
	if (!res) {
@@ -5346,12 +5343,9 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
		res = &temp_res;
	}

	dsi->phy_base = devm_ioremap(&dsidev->dev, res->start,
		resource_size(res));
	if (!dsi->phy_base) {
		DSSERR("can't ioremap DSI PHY\n");
		return -ENOMEM;
	}
	dsi->phy_base = devm_ioremap_resource(&dsidev->dev, res);
	if (IS_ERR(dsi->phy_base))
		return PTR_ERR(dsi->phy_base);

	res = platform_get_resource_byname(dsidev, IORESOURCE_MEM, "pll");
	if (!res) {
@@ -5366,12 +5360,9 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)
		res = &temp_res;
	}

	dsi->pll_base = devm_ioremap(&dsidev->dev, res->start,
		resource_size(res));
	if (!dsi->pll_base) {
		DSSERR("can't ioremap DSI PLL\n");
		return -ENOMEM;
	}
	dsi->pll_base = devm_ioremap_resource(&dsidev->dev, res);
	if (IS_ERR(dsi->pll_base))
		return PTR_ERR(dsi->pll_base);

	dsi->irq = platform_get_irq(dsi->pdev, 0);
	if (dsi->irq < 0) {
+3 −11
Original line number Diff line number Diff line
@@ -1158,17 +1158,9 @@ static int dss_bind(struct device *dev)
		return r;

	dss_mem = platform_get_resource(dss.pdev, IORESOURCE_MEM, 0);
	if (!dss_mem) {
		DSSERR("can't get IORESOURCE_MEM DSS\n");
		return -EINVAL;
	}

	dss.base = devm_ioremap(&pdev->dev, dss_mem->start,
				resource_size(dss_mem));
	if (!dss.base) {
		DSSERR("can't ioremap DSS\n");
		return -ENOMEM;
	}
	dss.base = devm_ioremap_resource(&pdev->dev, dss_mem);
	if (IS_ERR(dss.base))
		return PTR_ERR(dss.base);

	r = dss_get_clocks();
	if (r)
+1 −8
Original line number Diff line number Diff line
@@ -889,16 +889,9 @@ int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
	struct resource *res;

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
	if (!res) {
		DSSERR("can't get CORE mem resource\n");
		return -EINVAL;
	}

	core->base = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(core->base)) {
		DSSERR("can't ioremap CORE\n");
	if (IS_ERR(core->base))
		return PTR_ERR(core->base);
	}

	return 0;
}
+1 −8
Original line number Diff line number Diff line
@@ -910,16 +910,9 @@ int hdmi5_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
	struct resource *res;

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "core");
	if (!res) {
		DSSERR("can't get CORE IORESOURCE_MEM HDMI\n");
		return -EINVAL;
	}

	core->base = devm_ioremap_resource(&pdev->dev, res);
	if (IS_ERR(core->base)) {
		DSSERR("can't ioremap HDMI core\n");
	if (IS_ERR(core->base))
		return PTR_ERR(core->base);
	}

	return 0;
}
Loading