Unverified Commit b875b970 authored by Mark Brown's avatar Mark Brown
Browse files

spi: Remove the use of dev_err_probe()

Merge series from Xichao Zhao <zhao.xichao@vivo.com>:

The dev_err_probe() doesn't do anything when error is '-ENOMEM'. Therefore,
remove the useless call to dev_err_probe(), and just return the value instead.
parents c1dd310f 27848c08
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ static int amd_spi_pci_probe(struct pci_dev *pdev,
	/* Allocate storage for host and driver private data */
	host = devm_spi_alloc_host(dev, sizeof(struct amd_spi));
	if (!host)
		return dev_err_probe(dev, -ENOMEM, "Error allocating SPI host\n");
		return -ENOMEM;

	amd_spi = spi_controller_get_devdata(host);

@@ -47,8 +47,7 @@ static int amd_spi_pci_probe(struct pci_dev *pdev,
	amd_spi->io_remap_addr = devm_ioremap(dev, io_base_addr, AMD_HID2_MEM_SIZE);

	if (!amd_spi->io_remap_addr)
		return dev_err_probe(dev, -ENOMEM,
				"ioremap of SPI registers failed\n");
		return -ENOMEM;

	dev_dbg(dev, "io_remap_address: %p\n", amd_spi->io_remap_addr);

+1 −1
Original line number Diff line number Diff line
@@ -857,7 +857,7 @@ static int amd_spi_probe(struct platform_device *pdev)
	/* Allocate storage for host and driver private data */
	host = devm_spi_alloc_host(dev, sizeof(struct amd_spi));
	if (!host)
		return dev_err_probe(dev, -ENOMEM, "Error allocating SPI host\n");
		return -ENOMEM;

	amd_spi = spi_controller_get_devdata(host);
	amd_spi->io_remap_addr = devm_platform_ioremap_resource(pdev, 0);
+1 −1
Original line number Diff line number Diff line
@@ -733,7 +733,7 @@ static int aml_spisg_probe(struct platform_device *pdev)
	else
		ctlr = spi_alloc_host(dev, sizeof(*spisg));
	if (!ctlr)
		return dev_err_probe(dev, -ENOMEM, "controller allocation failed\n");
		return -ENOMEM;

	spisg = spi_controller_get_devdata(ctlr);
	spisg->controller = ctlr;
+1 −2
Original line number Diff line number Diff line
@@ -701,8 +701,7 @@ static int mchp_coreqspi_probe(struct platform_device *pdev)

	ctlr = devm_spi_alloc_host(&pdev->dev, sizeof(*qspi));
	if (!ctlr)
		return dev_err_probe(&pdev->dev, -ENOMEM,
				     "unable to allocate host for QSPI controller\n");
		return -ENOMEM;

	qspi = spi_controller_get_devdata(ctlr);
	platform_set_drvdata(pdev, qspi);
+1 −2
Original line number Diff line number Diff line
@@ -534,8 +534,7 @@ static int mchp_corespi_probe(struct platform_device *pdev)

	host = devm_spi_alloc_host(&pdev->dev, sizeof(*spi));
	if (!host)
		return dev_err_probe(&pdev->dev, -ENOMEM,
				     "unable to allocate host for SPI controller\n");
		return -ENOMEM;

	platform_set_drvdata(pdev, host);

Loading