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

Commit 1df21786 authored by Stephen Boyd's avatar Stephen Boyd Committed by Greg Kroah-Hartman
Browse files

tty: Remove dev_err() usage after platform_get_irq()



We don't need dev_err() messages when platform_get_irq() fails now that
platform_get_irq() prints an error message itself when something goes
wrong. Let's remove these prints with a simple semantic patch.

// <smpl>
@@
expression ret;
struct platform_device *E;
@@

ret =
(
platform_get_irq(E, ...)
|
platform_get_irq_byname(E, ...)
);

if ( \( ret < 0 \| ret <= 0 \) )
{
(
-if (ret != -EPROBE_DEFER)
-{ ...
-dev_err(...);
-... }
|
...
-dev_err(...);
)
...
}
// </smpl>

While we're here, remove braces on if statements that only have one
statement (manually).

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20190730181557.90391-45-swboyd@chromium.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 769d55c5
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -56,10 +56,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)

	/* get the interrupt */
	ret = platform_get_irq(pdev, 0);
	if (ret < 0) {
		dev_err(&pdev->dev, "irq not found - %i", ret);
	if (ret < 0)
		return ret;
	}
	data->uart.port.irq = ret;

	/* map the main registers */
+1 −3
Original line number Diff line number Diff line
@@ -106,10 +106,8 @@ static int lpc18xx_serial_probe(struct platform_device *pdev)
	int irq, ret;

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(&pdev->dev, "irq not found");
	if (irq < 0)
		return irq;
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
+1 −3
Original line number Diff line number Diff line
@@ -176,10 +176,8 @@ static int uniphier_uart_probe(struct platform_device *pdev)
		return -ENOMEM;

	irq = platform_get_irq(pdev, 0);
	if (irq < 0) {
		dev_err(dev, "failed to get IRQ number\n");
	if (irq < 0)
		return irq;
	}

	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
	if (!priv)
+1 −4
Original line number Diff line number Diff line
@@ -2718,11 +2718,8 @@ static int sbsa_uart_probe(struct platform_device *pdev)
		return -ENOMEM;

	ret = platform_get_irq(pdev, 0);
	if (ret < 0) {
		if (ret != -EPROBE_DEFER)
			dev_err(&pdev->dev, "cannot obtain irq\n");
	if (ret < 0)
		return ret;
	}
	uap->port.irq	= ret;

#ifdef CONFIG_ACPI_SPCR_TABLE
+1 −3
Original line number Diff line number Diff line
@@ -2385,10 +2385,8 @@ static int lpuart_probe(struct platform_device *pdev)
	sport->port.type = PORT_LPUART;
	sport->devtype = sdata->devtype;
	ret = platform_get_irq(pdev, 0);
	if (ret < 0) {
		dev_err(&pdev->dev, "cannot obtain irq\n");
	if (ret < 0)
		return ret;
	}
	sport->port.irq = ret;
	sport->port.iotype = sdata->iotype;
	if (lpuart_is_32(sport))
Loading