From patchwork Sun Oct 4 05:14:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 11815511 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 467DB139A for ; Sun, 4 Oct 2020 05:15:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22AE2206DD for ; Sun, 4 Oct 2020 05:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601788518; bh=joJaXkCxoHRNHVM+7YTNd2Idii36t2DaBAU3CYfAq08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CrS1TOYQXSif0rvJ8jFMurcg4vq6+etqXdZDo1IyJKbEBk0eMtWtamYtbWqnY2U5+ SUWPu6O2l6hkJjzbo0/7UkcNG7gqI2XL1Jaz3WqVIDLsIRjy4qmcCkNJz2GrTLhKLX VjLRSVAAwj/Qc9jqukY+Nn5UjWVk/0xtbJmB0beo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725875AbgJDFOz (ORCPT ); Sun, 4 Oct 2020 01:14:55 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35392 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgJDFOv (ORCPT ); Sun, 4 Oct 2020 01:14:51 -0400 Received: by mail-pf1-f194.google.com with SMTP id k8so4330774pfk.2; Sat, 03 Oct 2020 22:14:51 -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=jSj7Q4DJpFXdzJS4vXtNFyUBZMMtSs/e2uyvh4UrDmQ=; b=d39SzYM9WPmFOxpI4dDNg04wfqjYOZfPuqAHm7HfRCD86WiBloduBlPCeAs8r4HQKc R8o4NYzQF6tW1VmIP+Bu5cIMRzxc88EcdYXWtOtfO0jSw+CFAEBB7fNMirzpF7FwadZA KuABYR38LmpdxRvtQCBsAcPtsyxpDQ/LwjMMzv0xqxBRd16guskiXCjYQyLzORcBo9bH UhtcqAyG5Jh2WzXPOT5QI6kKkboJNS6ko82T2Q+fS0KM6Gm1TZEvAWT4qeru9zmTOZz3 +ZFPbLl8t1pUjGPy8segLS6Doo2ICzRIh7xNcpnyMBao1x9sWeehWTJkl7xpWde7pBJ3 75Gg== X-Gm-Message-State: AOAM532Et66OBdUjJ8UQ7U2H13SFaIz9oHH6vb/YGTqqJEKNh+vplxAA V7tbZyLXWQ7rgxnAeS+Jze0U4ha1+1g= X-Google-Smtp-Source: ABdhPJybuo0dyW8OLj8mYrHhMS47SCaTGtBZJS+mWm/CWtLz6MfEeeQJWsN379s5pc735Hfm4Af9vA== X-Received: by 2002:a65:4987:: with SMTP id r7mr8670662pgs.228.1601788490855; Sat, 03 Oct 2020 22:14:50 -0700 (PDT) Received: from localhost ([2601:647:5b00:1161:a4cc:eef9:fbc0:2781]) by smtp.gmail.com with ESMTPSA id u2sm6249750pji.50.2020.10.03.22.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 22:14:50 -0700 (PDT) From: Moritz Fischer To: linux-fpga@vger.kernel.org Cc: trix@redhat.com, hao.wu@intel.com, michal.simek@xilinx.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, russell.h.weight@intel.com, matthew.gerlach@intel.com, Moritz Fischer Subject: [PATCH 03/10] fpga: fpga-mgr: dfl-fme-mgr: Simplify registration Date: Sat, 3 Oct 2020 22:14:16 -0700 Message-Id: <20201004051423.75879-4-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 Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org Simplify registration using new devm_fpga_mgr_register() API. Signed-off-by: Moritz Fischer --- drivers/fpga/dfl-fme-mgr.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/fpga/dfl-fme-mgr.c b/drivers/fpga/dfl-fme-mgr.c index b3f7eee3c93f..3fc2be87d059 100644 --- a/drivers/fpga/dfl-fme-mgr.c +++ b/drivers/fpga/dfl-fme-mgr.c @@ -316,16 +316,7 @@ static int fme_mgr_probe(struct platform_device *pdev) mgr->compat_id = compat_id; platform_set_drvdata(pdev, mgr); - return fpga_mgr_register(mgr); -} - -static int fme_mgr_remove(struct platform_device *pdev) -{ - struct fpga_manager *mgr = platform_get_drvdata(pdev); - - fpga_mgr_unregister(mgr); - - return 0; + return devm_fpga_mgr_register(dev, mgr); } static struct platform_driver fme_mgr_driver = { @@ -333,7 +324,6 @@ static struct platform_driver fme_mgr_driver = { .name = DFL_FPGA_FME_MGR, }, .probe = fme_mgr_probe, - .remove = fme_mgr_remove, }; module_platform_driver(fme_mgr_driver);