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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdwB9+s5zDv+jpjFJAX8AXL0rTv=r19T-=ZSYtpAoYHpA@mail.gmail.com>
Date:   Thu, 24 Jan 2019 15:55:30 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Peng Hao <peng.hao2@....com.cn>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Arnd Bergmann <arnd@...db.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V4 5/6] misc/pvpanic: add pvpanic mmio driver

On Thu, Jan 24, 2019 at 10:17 AM Peng Hao <peng.hao2@....com.cn> wrote:
>
> Make pvpanic mmio driver as separate file and modify code
> in order to adapt the framework.

This should go as patch 3

>
> Signed-off-by: Peng Hao <peng.hao2@....com.cn>
> ---
>  drivers/misc/pvpanic/Kconfig      |  7 ++++++
>  drivers/misc/pvpanic/Makefile     |  1 +
>  drivers/misc/pvpanic/pvpanic-of.c | 53 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 61 insertions(+)
>  create mode 100644 drivers/misc/pvpanic/pvpanic-of.c
>
> diff --git a/drivers/misc/pvpanic/Kconfig b/drivers/misc/pvpanic/Kconfig
> index 1dcfe20..14074af 100644
> --- a/drivers/misc/pvpanic/Kconfig
> +++ b/drivers/misc/pvpanic/Kconfig
> @@ -16,5 +16,12 @@ config PVPANIC_ACPI
>           This driver is one specific driver for pvpanic driver framework.
>           It provides an acpi device as pvpanic device.
>
> +config PVPANIC_OF
> +       tristate "pvpanic mmio driver"
> +       depends on OF
> +       help
> +         This driver is one specific driver for pvpanic driver framework.
> +         It provides a mmio device as pvpanic device.
> +
>  endif
>
> diff --git a/drivers/misc/pvpanic/Makefile b/drivers/misc/pvpanic/Makefile
> index c5b73ca..63ef0db 100644
> --- a/drivers/misc/pvpanic/Makefile
> +++ b/drivers/misc/pvpanic/Makefile
> @@ -4,3 +4,4 @@
>
>  obj-$(CONFIG_PVPANIC)      += pvpanic.o
>  obj-$(CONFIG_PVPANIC_ACPI) += pvpanic-acpi.o
> +obj-$(CONFIG_PVPANIC_OF)   += pvpanic-of.o
> diff --git a/drivers/misc/pvpanic/pvpanic-of.c b/drivers/misc/pvpanic/pvpanic-of.c
> new file mode 100644
> index 0000000..73ca5f3
> --- /dev/null
> +++ b/drivers/misc/pvpanic/pvpanic-of.c
> @@ -0,0 +1,53 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + *  pvpanic of driver.
> + *
> + *  Copyright (C) 2019 ZTE Ltd.
> + *  Author: Peng Hao <peng.hao2@....com.cn>
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <linux/types.h>
> +#include "pvpanic.h"
> +
> +static int pvpanic_mmio_probe(struct platform_device *pdev)
> +{
> +       struct resource *res;
> +       int ret;
> +
> +       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +       if (!res)
> +               return -EINVAL;
> +
> +       ret = pvpanic_add_device(&pdev->dev, res);
> +       if (ret)
> +               return -ENODEV;
> +
> +       return 0;
> +}
> +
> +static int pvpanic_mmio_remove(struct platform_device *pdev)
> +{
> +       pvpanic_remove_device();
> +       return 0;
> +}
> +
> +static const struct of_device_id pvpanic_mmio_match[] = {
> +       { .compatible = "qemu,pvpanic-mmio", },
> +       {}
> +};
> +
> +static struct platform_driver pvpanic_mmio_driver = {
> +       .driver = {
> +               .name = "pvpanic-mmio",
> +               .of_match_table = pvpanic_mmio_match,
> +       },
> +       .probe = pvpanic_mmio_probe,
> +       .remove = pvpanic_mmio_remove,
> +};
> +
> +module_platform_driver(pvpanic_mmio_driver);
> --
> 1.8.3.1
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ