lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56C4AB85.7010708@gmail.com>
Date:	Wed, 17 Feb 2016 18:19:01 +0100
From:	Matthias Brugger <matthias.bgg@...il.com>
To:	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	linux-arm-kernel@...ts.infradead.org,
	Paul Gortmaker <paul.gortmaker@...driver.com>,
	linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
	Masahiro Yamada <yamada.masahiro@...ionext.com>,
	Peter Hurley <peter@...leysoftware.com>,
	Jiri Slaby <jslaby@...e.com>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Eddie Huang <eddie.huang@...iatek.com>,
	linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH v3 1/5] Revert "drivers/tty/serial: make 8250/8250_mtk.c
 explicitly non-modular"



On 17/02/16 16:02, Arnd Bergmann wrote:
> This reverts commit d72d391c126e ("drivers/tty/serial: make
> 8250/8250_mtk.c explicitly non-modular"), which intended to remove dead
> code but did not have the desired effect when the main 8250 driver was
> a module itself.
>
> This would normally result in a link error, but as the entire
> drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250
> is set, we never notice that the driver does not get built in this
> configuration.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---

Acked-by: Matthias Brugger <matthias.bgg@...il.com>

>   drivers/tty/serial/8250/8250_mtk.c | 35 ++++++++++++++++++++++++++++-------
>   1 file changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
> index 9038843cadc7..6ecc6e3e82dc 100644
> --- a/drivers/tty/serial/8250/8250_mtk.c
> +++ b/drivers/tty/serial/8250/8250_mtk.c
> @@ -16,7 +16,7 @@
>    */
>   #include <linux/clk.h>
>   #include <linux/io.h>
> -#include <linux/init.h>
> +#include <linux/module.h>
>   #include <linux/of_irq.h>
>   #include <linux/of_platform.h>
>   #include <linux/platform_device.h>
> @@ -245,6 +245,23 @@ static int mtk8250_probe(struct platform_device *pdev)
>   	return 0;
>   }
>
> +static int mtk8250_remove(struct platform_device *pdev)
> +{
> +	struct mtk8250_data *data = platform_get_drvdata(pdev);
> +
> +	pm_runtime_get_sync(&pdev->dev);
> +
> +	serial8250_unregister_port(data->line);
> +
> +	pm_runtime_disable(&pdev->dev);
> +	pm_runtime_put_noidle(&pdev->dev);
> +
> +	if (!pm_runtime_status_suspended(&pdev->dev))
> +		mtk8250_runtime_suspend(&pdev->dev);
> +
> +	return 0;
> +}
> +
>   static int __maybe_unused mtk8250_suspend(struct device *dev)
>   {
>   	struct mtk8250_data *data = dev_get_drvdata(dev);
> @@ -273,18 +290,18 @@ static const struct of_device_id mtk8250_of_match[] = {
>   	{ .compatible = "mediatek,mt6577-uart" },
>   	{ /* Sentinel */ }
>   };
> +MODULE_DEVICE_TABLE(of, mtk8250_of_match);
>
>   static struct platform_driver mtk8250_platform_driver = {
>   	.driver = {
> -		.name			= "mt6577-uart",
> -		.pm			= &mtk8250_pm_ops,
> -		.of_match_table		= mtk8250_of_match,
> -		.suppress_bind_attrs	= true,
> -
> +		.name		= "mt6577-uart",
> +		.pm		= &mtk8250_pm_ops,
> +		.of_match_table	= mtk8250_of_match,
>   	},
>   	.probe			= mtk8250_probe,
> +	.remove			= mtk8250_remove,
>   };
> -builtin_platform_driver(mtk8250_platform_driver);
> +module_platform_driver(mtk8250_platform_driver);
>
>   #ifdef CONFIG_SERIAL_8250_CONSOLE
>   static int __init early_mtk8250_setup(struct earlycon_device *device,
> @@ -300,3 +317,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device,
>
>   OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup);
>   #endif
> +
> +MODULE_AUTHOR("Matthias Brugger");
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("Mediatek 8250 serial port driver");
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ