From patchwork Sun Oct 4 05:14:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 11815527 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22A7A139A for ; Sun, 4 Oct 2020 05:15:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E63182068E for ; Sun, 4 Oct 2020 05:15:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="t/IHccT1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E63182068E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=21NatekhklS0NiJubNtDlpmWVYHcPwSFYisXe7QIRro=; b=t/IHccT1m+aeWHbCPOF4Moi5l A0Jm4PmmsWMSYUm8/GFyewH0fhht0TmOXiKyY49VmTpA1MVzXeGvO5Reb5L7WDbZ8H8d+NA84st5p hBmGX4umDR2paHWszzhz5eg2kCETXqlx57cX9zZzTKcERW4YjBX2gfEs/qHteTyAe1x3DjhzT+A7e Pn8X36aJwUMbO2zUbUEOgrNjHO0nfomp7Ba15JAzYw9eokIv7gJPye4lpetJxAL63HuaLFKy2+bgJ WCVc1yEpZc++ITKrDyizsHfhncrJJjSQcd4JpwRnU7mJXg7P5ZTgenGiGwZ4JrCuUMTrKPcA5zUwT 15W3Z2w5g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOwMj-0007MF-4R; Sun, 04 Oct 2020 05:15:21 +0000 Received: from mail-pg1-f195.google.com ([209.85.215.195]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOwMO-0007Gu-IQ for linux-arm-kernel@lists.infradead.org; Sun, 04 Oct 2020 05:15:02 +0000 Received: by mail-pg1-f195.google.com with SMTP id 34so3593535pgo.13 for ; Sat, 03 Oct 2020 22:15:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KEIkOfJmCkr+mhT8bgXa4RUyoZrWLuARarkprMlR8hc=; b=jmfGvR6y4D+Hrhr+X/6D3lv2Z7DxcM8vxI5Ue/JWws/m1+mQCajbkYDaJsLGmIoNzl TLwcP0P3RWvRvRdFUuaNVmItC+90p4NaqAgIO+SJP+1/n9Mw3rI46T26+BnjbMUDc9Ka jSFeqPOIkMKwyIw4Ub5rh62iS0sKFI0Q3xK5YztrLQMoR1FdW9wtqh+xbQE0aht1NG9m rOhaFUnfq7Ej3Fxj/hh6oV+GvyjMO5skck8UpE3n4vqMfULywGVKWEbQ9UhcBBbMw7IF bcKVgZ45S6mKiSSGawljCVDPD2wsZGF5MTvd03MfHvvieIStdnrBAV+K9Po25NmoXB6D 46Mg== X-Gm-Message-State: AOAM5324O/R6ez58LhYDXMyhOtTUyUe8+34WO3u9lHynOGmI0ORt+QSu wY/ACMC0mpXgRx3qPGbL7zI= X-Google-Smtp-Source: ABdhPJxBFvc18Vo2CntFUWWe0qTHBP6EsWSvDe3RC70HKzn/p+q5e49ivi4n+Rtv76OD8E2enCUyiQ== X-Received: by 2002:a62:2581:0:b029:13f:ba38:b113 with SMTP id l123-20020a6225810000b029013fba38b113mr10296040pfl.15.1601788499350; Sat, 03 Oct 2020 22:14:59 -0700 (PDT) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id q15sm6177964pjp.26.2020.10.03.22.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 22:14:58 -0700 (PDT) From: Moritz Fischer To: linux-fpga@vger.kernel.org Subject: [PATCH 10/10] fpga: fpga-mgr: altera-pr-ip: Simplify registration Date: Sat, 3 Oct 2020 22:14:23 -0700 Message-Id: <20201004051423.75879-11-mdf@kernel.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201004051423.75879-1-mdf@kernel.org> References: <20201004051423.75879-1-mdf@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201004_011500_963772_D92C5B08 X-CRM114-Status: GOOD ( 18.12 ) X-Spam-Score: 0.5 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (0.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.215.195 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.195 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [moritz.fischer.private[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: russell.h.weight@intel.com, trix@redhat.com, michal.simek@xilinx.com, matthew.gerlach@intel.com, linux-kernel@vger.kernel.org, Moritz Fischer , linux-arm-kernel@lists.infradead.org, hao.wu@intel.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Simplify registration using new devm_fpga_mgr_register() API. Remove the now obsolete altera_pr_unregister() function. Signed-off-by: Moritz Fischer --- We should take another look at this, IIRC correctly the point of splitting this up into a separate driver was to make it useable by a different (pci?) driver later on. It doesn't seem like this happened, and I think we should just make this a platform driver? --- drivers/fpga/altera-pr-ip-core-plat.c | 10 ---------- drivers/fpga/altera-pr-ip-core.c | 14 +------------- include/linux/fpga/altera-pr-ip-core.h | 1 - 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/fpga/altera-pr-ip-core-plat.c b/drivers/fpga/altera-pr-ip-core-plat.c index 99b9cc0e70f0..b008a6b8d2d3 100644 --- a/drivers/fpga/altera-pr-ip-core-plat.c +++ b/drivers/fpga/altera-pr-ip-core-plat.c @@ -28,15 +28,6 @@ static int alt_pr_platform_probe(struct platform_device *pdev) return alt_pr_register(dev, reg_base); } -static int alt_pr_platform_remove(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - - alt_pr_unregister(dev); - - return 0; -} - static const struct of_device_id alt_pr_of_match[] = { { .compatible = "altr,a10-pr-ip", }, {}, @@ -46,7 +37,6 @@ MODULE_DEVICE_TABLE(of, alt_pr_of_match); static struct platform_driver alt_pr_platform_driver = { .probe = alt_pr_platform_probe, - .remove = alt_pr_platform_remove, .driver = { .name = "alt_a10_pr_ip", .of_match_table = alt_pr_of_match, diff --git a/drivers/fpga/altera-pr-ip-core.c b/drivers/fpga/altera-pr-ip-core.c index 2cf25fd5e897..dfdf21ed34c4 100644 --- a/drivers/fpga/altera-pr-ip-core.c +++ b/drivers/fpga/altera-pr-ip-core.c @@ -195,22 +195,10 @@ int alt_pr_register(struct device *dev, void __iomem *reg_base) if (!mgr) return -ENOMEM; - dev_set_drvdata(dev, mgr); - - return fpga_mgr_register(mgr); + return devm_fpga_mgr_register(dev, mgr); } EXPORT_SYMBOL_GPL(alt_pr_register); -void alt_pr_unregister(struct device *dev) -{ - struct fpga_manager *mgr = dev_get_drvdata(dev); - - dev_dbg(dev, "%s\n", __func__); - - fpga_mgr_unregister(mgr); -} -EXPORT_SYMBOL_GPL(alt_pr_unregister); - MODULE_AUTHOR("Matthew Gerlach "); MODULE_DESCRIPTION("Altera Partial Reconfiguration IP Core"); MODULE_LICENSE("GPL v2"); diff --git a/include/linux/fpga/altera-pr-ip-core.h b/include/linux/fpga/altera-pr-ip-core.h index 0b08ac20ab16..a6b4c07858cc 100644 --- a/include/linux/fpga/altera-pr-ip-core.h +++ b/include/linux/fpga/altera-pr-ip-core.h @@ -13,6 +13,5 @@ #include int alt_pr_register(struct device *dev, void __iomem *reg_base); -void alt_pr_unregister(struct device *dev); #endif /* _ALT_PR_IP_CORE_H */