Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2014020imu; Thu, 24 Jan 2019 05:58:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN7rFqXFNiJfF0mFbhVUzev/ZN/2+YkevSLcFFQt5Hx9a/tE1wWWoyHqqCDy1o/8jqt55rFs X-Received: by 2002:a17:902:a5ca:: with SMTP id t10mr6616702plq.139.1548338280198; Thu, 24 Jan 2019 05:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548338280; cv=none; d=google.com; s=arc-20160816; b=lndzmFMOPel8StAx7ZUJAKAb8At0DFbWTyCVe3nc06Gvb8lYVnWeLBeb6V4qycCiaC MIOosgDCJloEhp8NLu3gcB3K1iRuPCf500INz89cB0LIe/7pL3k3juGicsLh0mWEel/H hs3NkKIwsU/AOz2yD/01so3WGjbzz+IYQ8VVpILxrwAq2kAv5Dmj/zeuRxN9KoQU0NFJ n6GzmB4j6qj1621OmRSWP/feh2BYAvizQFxB6XbmjRPGs8NpSpFsFrkC5ZfyYkn2Cw8z PAKFTNutG6dphykcLQjSJ2dOtp0olGM9nVxpLXmvWHK1JYUBS6pvA59CDS/2T76oKUF3 Jhnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=491IvpGaSmWKa7PkGtkxFDy4NBVxanVjoKrAyDu3yOs=; b=albWFOYVgYQXII37yY22V8y2qTzm8DXvWEQl0J2rdgaWOpUbfWeK6D+HEbsN1Zpdgt maCIiWbiY7SP8/BS8t1FuCvnqZQNml3xXEBsW0q+6vDptI1zQDmgrsYwtth5fo5/bNfp yBd3Nfgmsx+TFZ8orM/UAA62vGxhujmyd/vq5wW63kaB64ZR7b5h09MAHy6O25wc5X4B vu5tSouvOzoFxS41A5DnCTthTIrJbMVOuOJeux9LrYfuO8787Q7ddW7diX3TrgBpVM00 YNTy2+/qx+X+CRO4g7WUEKKw3J9S42S+Ksc12JLI9IydbaYVP4HFNW/tzwh+qzKwcLrf rsUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N5Aldbs9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si4818342plk.342.2019.01.24.05.57.44; Thu, 24 Jan 2019 05:58:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N5Aldbs9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728173AbfAXNzm (ORCPT + 99 others); Thu, 24 Jan 2019 08:55:42 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46179 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727730AbfAXNzm (ORCPT ); Thu, 24 Jan 2019 08:55:42 -0500 Received: by mail-pf1-f196.google.com with SMTP id c73so3003390pfe.13 for ; Thu, 24 Jan 2019 05:55:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=491IvpGaSmWKa7PkGtkxFDy4NBVxanVjoKrAyDu3yOs=; b=N5Aldbs9inrpcC0XL16UfwNrXnwog8pLSrA8zN9HSwWMybqjTJVct/fZ1cB5Gpa5lP 3WpmDbOJYTUKDH6EUF/YiNkoOCC5VhxZ3/+uZsCoajaO1Skc1ElISGzw08D/IYpzrgte P5w8a0tgzlr586G9MQhaNDx+JUqd8j0ENcowbk9797PIgQqnA5ZOBseqpxyLzDVRTJft DrjdFPOECx2dlrWM283kod/YU00jgMkvkvpIq70/kwANB7+rGQs41bdSruo11n0o4aIz GYHWRJP2omShtrjmWuZFHMWN+Y1GVtngP+tH9d0dBEp64UixdPs0Yo4/P44hWBOkNse3 G9Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=491IvpGaSmWKa7PkGtkxFDy4NBVxanVjoKrAyDu3yOs=; b=hXVjJYLqE5Rv1uFrBFB4Ty6UDge+ZImVoS3JWYLQp/jYYHgn8ICg3M+Yq59SNQw2mE N4eMk6GQoxaIsqJFcVxkmR91vrF8hdiTHsnC+lalj/qeKt/wldjPnnSTNjkk5YczBr18 3/5P+Ls6oQODtmGNtakGLwCrsONYPxF7grrRV85jb0nHVUmuNjVeAKBcM5xDBMo3c0Qg r8dN3mJ2QRjIs+AzfBZrK3SkOBHcKbqt3Sqhd/TuAjVWydE2zeP6LM3SoZ2nml5WA02s us2s6IRwHz66v5JkpoZKKzIWZJhOHR8vJ08QDJ9eVPJbQMwMyN0TBiGu+Y+46KP65uNR FYKg== X-Gm-Message-State: AJcUukeT5sgS1wsKV5UrWj9qL2xV9zQs62SgsrgQat76/xg6U0/vCFf0 4fS/jIt6pNmbSZ2B7IPZAhlWLXU2jef6dul4Uk4= X-Received: by 2002:a63:f615:: with SMTP id m21mr6117334pgh.428.1548338141318; Thu, 24 Jan 2019 05:55:41 -0800 (PST) MIME-Version: 1.0 References: <1548348038-69560-1-git-send-email-peng.hao2@zte.com.cn> <1548348038-69560-6-git-send-email-peng.hao2@zte.com.cn> In-Reply-To: <1548348038-69560-6-git-send-email-peng.hao2@zte.com.cn> From: Andy Shevchenko Date: Thu, 24 Jan 2019 15:55:30 +0200 Message-ID: Subject: Re: [PATCH V4 5/6] misc/pvpanic: add pvpanic mmio driver To: Peng Hao Cc: Greg Kroah-Hartman , Arnd Bergmann , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 24, 2019 at 10:17 AM Peng Hao 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 > --- > 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 > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#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