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

Commit 9bb827e5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: remove NULL check from drivers"

parents 36a3065b d925acdc
Loading
Loading
Loading
Loading
+9 −13
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -185,12 +185,10 @@ static int csr_probe(struct platform_device *pdev)
	if (coresight_fuse_access_disabled())
		return -EPERM;

	if (pdev->dev.of_node) {
	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
	pdev->dev.platform_data = pdata;
	}

	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
@@ -209,12 +207,10 @@ static int csr_probe(struct platform_device *pdev)
	if (!drvdata->base)
		return -ENOMEM;

	if (pdev->dev.of_node) {
	ret = of_property_read_u32(pdev->dev.of_node, "qcom,blk-size",
			&drvdata->blksize);
	if (ret)
		drvdata->blksize = BLKSIZE_256;
	}

	desc = devm_kzalloc(dev, sizeof(*desc), GFP_KERNEL);
	if (!desc)
+17 −23
Original line number Diff line number Diff line
@@ -1404,12 +1404,10 @@ static int cti_probe(struct platform_device *pdev)
	if (coresight_fuse_access_disabled())
		return -EPERM;

	if (pdev->dev.of_node) {
	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
	pdev->dev.platform_data = pdata;
	}

	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
@@ -1444,14 +1442,12 @@ static int cti_probe(struct platform_device *pdev)
		return -ENOMEM;

	drvdata->gpio_trigin->trig = -1;
	if (pdev->dev.of_node) {
	ret = of_property_read_u32(pdev->dev.of_node,
				   "qcom,cti-gpio-trigin", &trig);
	if (!ret)
		drvdata->gpio_trigin->trig = trig;
	else if (ret != -EINVAL)
		return ret;
	}

	drvdata->gpio_trigout = devm_kzalloc(dev, sizeof(struct cti_pctrl),
					     GFP_KERNEL);
@@ -1459,14 +1455,12 @@ static int cti_probe(struct platform_device *pdev)
		return -ENOMEM;

	drvdata->gpio_trigout->trig = -1;
	if (pdev->dev.of_node) {
	ret = of_property_read_u32(pdev->dev.of_node,
				   "qcom,cti-gpio-trigout", &trig);
	if (!ret)
		drvdata->gpio_trigout->trig = trig;
	else if (ret != -EINVAL)
		return ret;
	}

	drvdata->cpu = -1;
	cpu_phandle = of_get_property(pdev->dev.of_node, "coresight-cti-cpu",
@@ -1490,7 +1484,7 @@ static int cti_probe(struct platform_device *pdev)
		}
	}

	if (pdev->dev.of_node && !cti_save_disable)
	if (!cti_save_disable)
		drvdata->cti_save = of_property_read_bool(pdev->dev.of_node,
							  "qcom,cti-save");
	if (drvdata->cti_save) {
+25 −29
Original line number Diff line number Diff line
@@ -810,12 +810,10 @@ static int dbgui_probe(struct platform_device *pdev)
	if (coresight_fuse_access_disabled())
		return -EPERM;

	if (pdev->dev.of_node) {
	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
	pdev->dev.platform_data = pdata;
	}

	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
@@ -859,7 +857,6 @@ static int dbgui_probe(struct platform_device *pdev)
		dev_err(dev, "DBGUI REG dump allocation failed\n");
	}

	if (pdev->dev.of_node) {
	ret = of_property_read_u32(pdev->dev.of_node,
			"qcom,dbgui-addr-offset",
			&drvdata->addr_offset);
@@ -883,7 +880,6 @@ static int dbgui_probe(struct platform_device *pdev)
			&drvdata->size);
	if (ret || drvdata->size > DBGUI_MAX_ADDR_VAL)
		return -EINVAL;
	}

	ret = clk_prepare_enable(drvdata->clk);
	if (ret)
+6 −9
Original line number Diff line number Diff line
@@ -2253,12 +2253,10 @@ static int etm_probe(struct platform_device *pdev)
	    coresight_fuse_apps_access_disabled())
		return -EPERM;

	if (pdev->dev.of_node) {
	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
	pdev->dev.platform_data = pdata;
	}

	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
@@ -2279,7 +2277,6 @@ static int etm_probe(struct platform_device *pdev)
	mutex_init(&drvdata->mutex);
	wakeup_source_init(&drvdata->ws, "coresight-etm");

	if (pdev->dev.of_node)
	drvdata->pcsave_impl = of_property_read_bool(pdev->dev.of_node,
						     "qcom,pc-save");

+4 −6
Original line number Diff line number Diff line
@@ -3460,12 +3460,10 @@ static int etm_probe(struct platform_device *pdev)
	    coresight_fuse_apps_access_disabled())
		return -EPERM;

	if (pdev->dev.of_node) {
	pdata = of_get_coresight_platform_data(dev, pdev->dev.of_node);
	if (IS_ERR(pdata))
		return PTR_ERR(pdata);
	pdev->dev.platform_data = pdata;
	}

	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
Loading