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

Commit 43b829b3 authored by Jingoo Han's avatar Jingoo Han Committed by Greg Kroah-Hartman
Browse files

serial: remove unnecessary platform_set_drvdata()



The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d063
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarBarry Song <baohua.song@csr.com>
Acked-by: default avatarTony Prisk <linux@prisktech.co.nz>
Acked-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74b3b4cd
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -703,7 +703,6 @@ static int ar933x_uart_remove(struct platform_device *pdev)
	struct ar933x_uart_port *up;

	up = platform_get_drvdata(pdev);
	platform_set_drvdata(pdev, NULL);

	if (up) {
		uart_remove_one_port(&ar933x_uart_driver, &up->port);
+0 −1
Original line number Diff line number Diff line
@@ -1860,7 +1860,6 @@ static int atmel_serial_remove(struct platform_device *pdev)
	int ret = 0;

	device_init_wakeup(&pdev->dev, 0);
	platform_set_drvdata(pdev, NULL);

	ret = uart_remove_one_port(&atmel_uart, port);

+0 −1
Original line number Diff line number Diff line
@@ -852,7 +852,6 @@ static int bcm_uart_remove(struct platform_device *pdev)

	port = platform_get_drvdata(pdev);
	uart_remove_one_port(&bcm_uart_driver, port);
	platform_set_drvdata(pdev, NULL);
	/* mark port as free */
	ports[pdev->id].membase = 0;
	return 0;
+2 −9
Original line number Diff line number Diff line
@@ -438,8 +438,7 @@ static int uart_clps711x_probe(struct platform_device *pdev)
	s->uart_clk = devm_clk_get(&pdev->dev, "uart");
	if (IS_ERR(s->uart_clk)) {
		dev_err(&pdev->dev, "Can't get UART clocks\n");
		ret = PTR_ERR(s->uart_clk);
		goto err_out;
		return PTR_ERR(s->uart_clk);
	}

	s->uart.owner		= THIS_MODULE;
@@ -461,7 +460,7 @@ static int uart_clps711x_probe(struct platform_device *pdev)
	if (ret) {
		dev_err(&pdev->dev, "Registering UART driver failed\n");
		devm_clk_put(&pdev->dev, s->uart_clk);
		goto err_out;
		return ret;
	}

	for (i = 0; i < UART_CLPS711X_NR; i++) {
@@ -478,11 +477,6 @@ static int uart_clps711x_probe(struct platform_device *pdev)
	}

	return 0;

err_out:
	platform_set_drvdata(pdev, NULL);

	return ret;
}

static int uart_clps711x_remove(struct platform_device *pdev)
@@ -495,7 +489,6 @@ static int uart_clps711x_remove(struct platform_device *pdev)

	devm_clk_put(&pdev->dev, s->uart_clk);
	uart_unregister_driver(&s->uart);
	platform_set_drvdata(pdev, NULL);

	return 0;
}
+0 −2
Original line number Diff line number Diff line
@@ -778,8 +778,6 @@ static int efm32_uart_remove(struct platform_device *pdev)
{
	struct efm32_uart_port *efm_port = platform_get_drvdata(pdev);

	platform_set_drvdata(pdev, NULL);

	uart_remove_one_port(&efm32_uart_reg, &efm_port->port);

	if (pdev->id >= 0 && pdev->id < ARRAY_SIZE(efm32_uart_ports))
Loading