From patchwork Sun Oct 18 16:00:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 55177 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id 49DBE22F11 for ; Sun, 18 Oct 2015 16:00:46 +0000 (UTC) Received: by lbbpp2 with SMTP id pp2sf5920103lbb.0 for ; Sun, 18 Oct 2015 09:00:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=P352mE3IUNUOHRW7iEMRuOCzMvmsXlXkHrVZmMMJCbg=; b=CP/nSX2ZKpZ8DYIxARPLn4vtG9lK7O9EfOUY1YPZPOB/hPUrv9IpTvJM5cIYmSrkST gmUVXuH3AQiSGNDQESOkd7wXaRE2HBt/QPHVQtAKAo6+cMvCYhhHCr15Y3rInaq160MW oU6DJ703PwcZunO1LZXaxi4eqQ4AGvahvp+BC1mH+59sd6ZGmZB+I2/S/1snVLZqNred Jel/qDoSQDXCTn5mWWSXSOfllndIFC7QYxeXKXUIQ7tZ5RkvSK90ORZ5rxz53q0qAf/A 7aFqNd+zt22rHEupgtWVpORrn2UKazxWFS83974JQkteabHR62UW38toJvXLPrkA+KgS 5KFQ== X-Gm-Message-State: ALoCoQlmqc7imzzcMETd8c6cQe0yHxiYOhg/ldH/sTmTEus1h4Ec/pnfU0gXe7dNPSGdS8lM3A8X X-Received: by 10.112.140.202 with SMTP id ri10mr5944599lbb.10.1445184045313; Sun, 18 Oct 2015 09:00:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.159.82 with SMTP id i79ls445429lfe.102.gmail; Sun, 18 Oct 2015 09:00:45 -0700 (PDT) X-Received: by 10.112.62.194 with SMTP id a2mr11650782lbs.80.1445184045021; Sun, 18 Oct 2015 09:00:45 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id s66si8668417lfs.93.2015.10.18.09.00.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 09:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbbpp2 with SMTP id pp2so98602747lbb.0 for ; Sun, 18 Oct 2015 09:00:44 -0700 (PDT) X-Received: by 10.112.199.137 with SMTP id jk9mr12539867lbc.86.1445184044885; Sun, 18 Oct 2015 09:00:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1033822lbq; Sun, 18 Oct 2015 09:00:44 -0700 (PDT) X-Received: by 10.194.7.232 with SMTP id m8mr28705210wja.56.1445184044149; Sun, 18 Oct 2015 09:00:44 -0700 (PDT) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com. [209.85.212.172]) by mx.google.com with ESMTPS id z1si35993494wjw.9.2015.10.18.09.00.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 09:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.172 as permitted sender) client-ip=209.85.212.172; Received: by wicll6 with SMTP id ll6so65670659wic.0 for ; Sun, 18 Oct 2015 09:00:44 -0700 (PDT) X-Received: by 10.180.85.226 with SMTP id k2mr16583879wiz.67.1445184043974; Sun, 18 Oct 2015 09:00:43 -0700 (PDT) Received: from gnx2579.st.com. ([78.232.41.119]) by smtp.gmail.com with ESMTPSA id jd7sm34740323wjb.19.2015.10.18.09.00.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Oct 2015 09:00:43 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, alex.williamson@redhat.com, b.reynal@virtualopensystems.com, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: christoffer.dall@linaro.org, linux-kernel@vger.kernel.org, patches@linaro.org Subject: [PATCH 2/4] vfio: platform: reset: calxedaxgmac: add reset function registration Date: Sun, 18 Oct 2015 18:00:13 +0200 Message-Id: <1445184015-24414-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445184015-24414-1-git-send-email-eric.auger@linaro.org> References: <1445184015-24414-1-git-send-email-eric.auger@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch adds the reset function registration/unregistration. Also a MODULE_ALIAS is added. Signed-off-by: Eric Auger --- .../platform/reset/vfio_platform_calxedaxgmac.c | 40 ++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c b/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c index 619dc7d..4f76b17 100644 --- a/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c +++ b/drivers/vfio/platform/reset/vfio_platform_calxedaxgmac.c @@ -29,8 +29,7 @@ #define DRIVER_VERSION "0.1" #define DRIVER_AUTHOR "Eric Auger " #define DRIVER_DESC "Reset support for Calxeda xgmac vfio platform device" - -#define CALXEDAXGMAC_COMPAT "calxeda,hb-xgmac" +#define COMPAT "calxeda,hb-xgmac" /* XGMAC Register definitions */ #define XGMAC_CONTROL 0x00000000 /* MAC Configuration */ @@ -80,6 +79,43 @@ int vfio_platform_calxedaxgmac_reset(struct vfio_platform_device *vdev) } EXPORT_SYMBOL_GPL(vfio_platform_calxedaxgmac_reset); +static int __init vfio_platform_calxedaxgmac_init(void) +{ + int (*register_reset)(struct module *, char*, + vfio_platform_reset_fn_t); + int ret; + + register_reset = symbol_get(vfio_platform_register_reset); + if (!register_reset) + return -EINVAL; + + ret = register_reset(THIS_MODULE, COMPAT, + vfio_platform_calxedaxgmac_reset); + + symbol_put(vfio_platform_register_reset); + + return ret; +} + +static void __exit vfio_platform_calxedaxgmac_exit(void) +{ + int (*unregister_reset)(char *); + int ret; + + unregister_reset = symbol_get(vfio_platform_unregister_reset); + if (!unregister_reset) + return; + + ret = unregister_reset(COMPAT); + + symbol_put(vfio_platform_unregister_reset); +} + +module_init(vfio_platform_calxedaxgmac_init); +module_exit(vfio_platform_calxedaxgmac_exit); + +MODULE_ALIAS("vfio-reset:" COMPAT); + MODULE_VERSION(DRIVER_VERSION); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR(DRIVER_AUTHOR);