Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3286161ybl; Sun, 11 Aug 2019 20:09:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqymAHoaJDdlO9ry4Pavb01H7InUrRfNQBSOh7ZT6U+zr8vtAsjago0UTK4eLZNd3xaG/bB/ X-Received: by 2002:a65:41c6:: with SMTP id b6mr28215751pgq.269.1565579358608; Sun, 11 Aug 2019 20:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565579358; cv=none; d=google.com; s=arc-20160816; b=zeIBKkKtXkkYeWS7zc61Ln9gW067LaEk8TM9UbiKRuofOrf2xTWXpGtyWACaszywul Ikt09ETSyla4npz/Za9/FhL3ntToejHT0Es/FY1REFT5RF02ZAwTLLUD8U8aeOKCT24Z o8vKHqH2m/I753ti4om2GxSWbg7HM/YM9TpsNRiHMLCK7wPHQbh0Sw+NWwHMuYjTj2Wk NfxAXFbCL+PqV1tvMumL/uHTuTB6UbkqJ2lcbjQ3e+2GbqP0oBdLOjuKRUsWbFZ0kpq7 KnBpy65M8uoZ1OCdAAZC3hTYaYfSHIwg5ZyG6HR7OUPkJPEItbBIsGC1FsGOoY+1mnxs 4LJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=tPWrkPD2AWb3dGSzuJdplkaviMoIyxBzGw3q6s8kbHo=; b=B7hyZyftMBCZTjNPicwf46/I6APsuUvcjS+DPa56DvKZB/e2uiBOOzK+TNfbpNkgBU PvHaykqn85AnC32Qd3TdXxwXi7f2+mQCIMKDBE4HD9qCVKQJ2cJvk4zpb/wmX/caqViT ikbyhcibGOPjG0GDprgR5m6DuZHZJjOpTuw9E2Iyj2wh8AHncCx8NhseuNYTobXy1zwJ jsnZmet/h3NfwoZGJrHXaE0+yuDKPv79Um5bV8ft/CGnuugo1OqDGqR2RIIuu2cj58uK RCo4uQGTE4Eu/mv/WRbeOYk2U9nScud+F4H7p3VGo4oyLh/4p5oBVrT65YEmfJJ9zFOU rFGA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b16si65276224pfd.126.2019.08.11.20.09.03; Sun, 11 Aug 2019 20:09:18 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbfHLDHx (ORCPT + 99 others); Sun, 11 Aug 2019 23:07:53 -0400 Received: from mga17.intel.com ([192.55.52.151]:12631 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726656AbfHLDHu (ORCPT ); Sun, 11 Aug 2019 23:07:50 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Aug 2019 20:07:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,375,1559545200"; d="scan'208";a="199987467" Received: from hao-dev.bj.intel.com ([10.238.157.65]) by fmsmga004.fm.intel.com with ESMTP; 11 Aug 2019 20:07:48 -0700 From: Wu Hao To: gregkh@linuxfoundation.org, mdf@kernel.org, linux-fpga@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, atull@kernel.org, Wu Hao Subject: [PATCH v5 2/9] fpga: dfl: fme: convert platform_driver to use dev_groups Date: Mon, 12 Aug 2019 10:49:57 +0800 Message-Id: <1565578204-13969-3-git-send-email-hao.wu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1565578204-13969-1-git-send-email-hao.wu@intel.com> References: <1565578204-13969-1-git-send-email-hao.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch takes advantage of driver core which helps to create and remove sysfs attribute files, so there is no need to register sysfs entries manually in dfl-fme platform river code. Signed-off-by: Wu Hao --- drivers/fpga/dfl-fme-main.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/fpga/dfl-fme-main.c b/drivers/fpga/dfl-fme-main.c index f033f1c..bf8114d 100644 --- a/drivers/fpga/dfl-fme-main.c +++ b/drivers/fpga/dfl-fme-main.c @@ -129,30 +129,6 @@ static ssize_t socket_id_show(struct device *dev, }; ATTRIBUTE_GROUPS(fme_hdr); -static int fme_hdr_init(struct platform_device *pdev, - struct dfl_feature *feature) -{ - void __iomem *base = feature->ioaddr; - int ret; - - dev_dbg(&pdev->dev, "FME HDR Init.\n"); - dev_dbg(&pdev->dev, "FME cap %llx.\n", - (unsigned long long)readq(base + FME_HDR_CAP)); - - ret = device_add_groups(&pdev->dev, fme_hdr_groups); - if (ret) - return ret; - - return 0; -} - -static void fme_hdr_uinit(struct platform_device *pdev, - struct dfl_feature *feature) -{ - dev_dbg(&pdev->dev, "FME HDR UInit.\n"); - device_remove_groups(&pdev->dev, fme_hdr_groups); -} - static long fme_hdr_ioctl_release_port(struct dfl_feature_platform_data *pdata, unsigned long arg) { @@ -199,8 +175,6 @@ static long fme_hdr_ioctl(struct platform_device *pdev, }; static const struct dfl_feature_ops fme_hdr_ops = { - .init = fme_hdr_init, - .uinit = fme_hdr_uinit, .ioctl = fme_hdr_ioctl, }; @@ -361,7 +335,8 @@ static int fme_remove(struct platform_device *pdev) static struct platform_driver fme_driver = { .driver = { - .name = DFL_FPGA_FEATURE_DEV_FME, + .name = DFL_FPGA_FEATURE_DEV_FME, + .dev_groups = fme_hdr_groups, }, .probe = fme_probe, .remove = fme_remove, -- 1.8.3.1