From patchwork Wed Sep 12 14:43:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Tull X-Patchwork-Id: 10597663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D67914E5 for ; Wed, 12 Sep 2018 14:44:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DC002A2FF for ; Wed, 12 Sep 2018 14:44:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 720402A30A; Wed, 12 Sep 2018 14:44:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E1362A2FF for ; Wed, 12 Sep 2018 14:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728133AbeILTsW (ORCPT ); Wed, 12 Sep 2018 15:48:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:60446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726819AbeILTsW (ORCPT ); Wed, 12 Sep 2018 15:48:22 -0400 Received: from localhost.localdomain (unknown [192.55.54.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9DC7420890; Wed, 12 Sep 2018 14:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536763413; bh=QhFHXF8dJGKnbYhMTMXvdCE6dwgbyIqjiV0Bek7Ob1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yWfBmncuMLqFsza8fElpeokdccB2ltPGrTfeXznh2Pv2qUL8oGbBTI7jTpy0eboay Bw3yAaHimJP+LM+e1s98KFcuoyWI9l6B4nDVrsnuNRs8vVutFUJ8FFvTnkwHHd5YWS nQogonRR5gwC6k8SWcyTFWnwiwkUBBwea/TgkOH8= From: Alan Tull To: Greg Kroah-Hartman Cc: Moritz Fischer , Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH 1/5] fpga: do not access region struct after fpga_region_unregister Date: Wed, 12 Sep 2018 09:43:23 -0500 Message-Id: <20180912144327.3130-2-atull@kernel.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180912144327.3130-1-atull@kernel.org> References: <20180912144327.3130-1-atull@kernel.org> Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A couple drivers were accessing the region struct after it had been freed. Save off the pointer to the mgr before the region struct gets freed. Signed-off-by: Alan Tull Acked-by: Moritz Fischer --- drivers/fpga/dfl-fme-region.c | 4 +++- drivers/fpga/of-fpga-region.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/fpga/dfl-fme-region.c b/drivers/fpga/dfl-fme-region.c index 0b7e19c..51a5ac2 100644 --- a/drivers/fpga/dfl-fme-region.c +++ b/drivers/fpga/dfl-fme-region.c @@ -14,6 +14,7 @@ */ #include +#include #include #include "dfl-fme-pr.h" @@ -66,9 +67,10 @@ static int fme_region_probe(struct platform_device *pdev) static int fme_region_remove(struct platform_device *pdev) { struct fpga_region *region = dev_get_drvdata(&pdev->dev); + struct fpga_manager *mgr = region->mgr; fpga_region_unregister(region); - fpga_mgr_put(region->mgr); + fpga_mgr_put(mgr); return 0; } diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c index 35fabb8..052a134 100644 --- a/drivers/fpga/of-fpga-region.c +++ b/drivers/fpga/of-fpga-region.c @@ -437,9 +437,10 @@ static int of_fpga_region_probe(struct platform_device *pdev) static int of_fpga_region_remove(struct platform_device *pdev) { struct fpga_region *region = platform_get_drvdata(pdev); + struct fpga_manager *mgr = region->mgr; fpga_region_unregister(region); - fpga_mgr_put(region->mgr); + fpga_mgr_put(mgr); return 0; } From patchwork Wed Sep 12 14:43:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Tull X-Patchwork-Id: 10597661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04AEB920 for ; Wed, 12 Sep 2018 14:43:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA2FF2A2FF for ; Wed, 12 Sep 2018 14:43:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEE522A30A; Wed, 12 Sep 2018 14:43:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B59992A2FF for ; Wed, 12 Sep 2018 14:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728154AbeILTsX (ORCPT ); Wed, 12 Sep 2018 15:48:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:60462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728132AbeILTsX (ORCPT ); Wed, 12 Sep 2018 15:48:23 -0400 Received: from localhost.localdomain (unknown [192.55.54.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D4062088E; Wed, 12 Sep 2018 14:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536763413; bh=mP4Bf0/c/wBawATTDnhsc+tAbQinsJif7dRSNWsHxGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lYsfKjBFrT32XECqqT3CmQvtSzM6uy+wC3KpPHd6H/YhxDCz60O1QOCwRVnLNwrnu ndvmv6q1foCredR9UHxG4gcWgF1QmvDZAy5Y5c1OyJK48p8z1V+cl8oEw259wRJ6UU 1FwOFrTyVqQLxYzA/yRN7ocUFyWqSuEn6XmXcXJs= From: Alan Tull To: Greg Kroah-Hartman Cc: Moritz Fischer , Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH 2/5] fpga: bridge: fix obvious function documentation error Date: Wed, 12 Sep 2018 09:43:24 -0500 Message-Id: <20180912144327.3130-3-atull@kernel.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180912144327.3130-1-atull@kernel.org> References: <20180912144327.3130-1-atull@kernel.org> Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fpga_bridge_dev_match() returns a FPGA bridge struct, not a FPGA manager struct so s/manager/bridge/. Signed-off-by: Alan Tull Acked-by: Moritz Fischer --- drivers/fpga/fpga-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index 24b8f98..c983dac 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -125,7 +125,7 @@ static int fpga_bridge_dev_match(struct device *dev, const void *data) * * Given a device, get an exclusive reference to a fpga bridge. * - * Return: fpga manager struct or IS_ERR() condition containing error code. + * Return: fpga bridge struct or IS_ERR() condition containing error code. */ struct fpga_bridge *fpga_bridge_get(struct device *dev, struct fpga_image_info *info) From patchwork Wed Sep 12 14:43:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Tull X-Patchwork-Id: 10597659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3D0E614E5 for ; Wed, 12 Sep 2018 14:43:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29C692A2FF for ; Wed, 12 Sep 2018 14:43:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DD202A30A; Wed, 12 Sep 2018 14:43:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBD552A2FF for ; Wed, 12 Sep 2018 14:43:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728181AbeILTsY (ORCPT ); Wed, 12 Sep 2018 15:48:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:60506 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726819AbeILTsX (ORCPT ); Wed, 12 Sep 2018 15:48:23 -0400 Received: from localhost.localdomain (unknown [192.55.54.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 202EB20890; Wed, 12 Sep 2018 14:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536763414; bh=yKljEVtdaoaWDOq+fXyi2HFOTsAsLv6SxqNeUvjjTCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t+30j7m6jm4BgDlz5FsfKjssrTk82n8SCm8Ybjv/V5xXF+pc2tF7YJHaPK4IFG7ke Wc4SIyOPS+I0JLzFcmLjX59opHGa7mY58BfU5EF8xXYNiyF7OJrgSor4DGpGp4Qu3T v04CG3eFU8emUsCeuyj1/xh8+lkbgRRltOVzmetw= From: Alan Tull To: Greg Kroah-Hartman Cc: Moritz Fischer , Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH 3/5] docs: fpga: document fpga manager flags Date: Wed, 12 Sep 2018 09:43:25 -0500 Message-Id: <20180912144327.3130-4-atull@kernel.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180912144327.3130-1-atull@kernel.org> References: <20180912144327.3130-1-atull@kernel.org> Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add flags #defines to kerneldoc documentation in a useful place. Signed-off-by: Alan Tull Acked-by: Moritz Fischer --- Documentation/driver-api/fpga/fpga-mgr.rst | 5 +++++ include/linux/fpga/fpga-mgr.h | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Documentation/driver-api/fpga/fpga-mgr.rst b/Documentation/driver-api/fpga/fpga-mgr.rst index 4b3825d..82b6dbb 100644 --- a/Documentation/driver-api/fpga/fpga-mgr.rst +++ b/Documentation/driver-api/fpga/fpga-mgr.rst @@ -184,6 +184,11 @@ API for implementing a new FPGA Manager driver API for programming an FPGA --------------------------- +FPGA Manager flags + +.. kernel-doc:: include/linux/fpga/fpga-mgr.h + :doc: FPGA Manager flags + .. kernel-doc:: include/linux/fpga/fpga-mgr.h :functions: fpga_image_info diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index 8942e61..8ab5df7 100644 --- a/include/linux/fpga/fpga-mgr.h +++ b/include/linux/fpga/fpga-mgr.h @@ -53,12 +53,20 @@ enum fpga_mgr_states { FPGA_MGR_STATE_OPERATING, }; -/* - * FPGA Manager flags - * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported - * FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting - * FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first - * FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed +/** + * DOC: FPGA Manager flags + * + * Flags used in the &fpga_image_info->flags field + * + * %FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported + * + * %FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting + * + * %FPGA_MGR_ENCRYPTED_BITSTREAM: indicates bitstream is encrypted + * + * %FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first + * + * %FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed */ #define FPGA_MGR_PARTIAL_RECONFIG BIT(0) #define FPGA_MGR_EXTERNAL_CONFIG BIT(1) From patchwork Wed Sep 12 14:43:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Tull X-Patchwork-Id: 10597657 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B57F14E5 for ; Wed, 12 Sep 2018 14:43:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A0262A2FF for ; Wed, 12 Sep 2018 14:43:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E1362A30A; Wed, 12 Sep 2018 14:43:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAF0D2A2FF for ; Wed, 12 Sep 2018 14:43:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbeILTsZ (ORCPT ); Wed, 12 Sep 2018 15:48:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:60522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728132AbeILTsY (ORCPT ); Wed, 12 Sep 2018 15:48:24 -0400 Received: from localhost.localdomain (unknown [192.55.54.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CBF4520866; Wed, 12 Sep 2018 14:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536763415; bh=yFDq3gNJ0hc98aJKWqK6WwpK5PXmEqtuFNi9c/xujoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bQ5fSsZr1H87BJlA4Wr6lqoIiip4NYOhIrOfZ8iRwc/yR0NtrQBEX6IDIe6JXIKx5 ujlXrS1UjkCEjbZJIHSuhUI8VSDkg87EnoCZ8AwY78Q0ObucyfPYQ99Loe8OzjxwO3 f9Sl6qTdHyk9WuuiBEb9k5PMID84MRlNjM0MJuNA= From: Alan Tull To: Greg Kroah-Hartman Cc: Moritz Fischer , Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH 4/5] fpga: of-fpga-region: Use platform_set_drvdata Date: Wed, 12 Sep 2018 09:43:26 -0500 Message-Id: <20180912144327.3130-5-atull@kernel.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180912144327.3130-1-atull@kernel.org> References: <20180912144327.3130-1-atull@kernel.org> Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Moritz Fischer Use platform_set_drvdata rather than dev_set_drvdata to match the platform_get_drvdata in the _remove() function of the platform driver. Signed-off-by: Moritz Fischer Acked-by: Alan Tull --- drivers/fpga/of-fpga-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c index 052a134..d6a70e4 100644 --- a/drivers/fpga/of-fpga-region.c +++ b/drivers/fpga/of-fpga-region.c @@ -421,7 +421,7 @@ static int of_fpga_region_probe(struct platform_device *pdev) goto eprobe_free; of_platform_populate(np, fpga_region_of_match, NULL, ®ion->dev); - dev_set_drvdata(dev, region); + platform_set_drvdata(pdev, region); dev_info(dev, "FPGA Region probed\n"); From patchwork Wed Sep 12 14:43:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Tull X-Patchwork-Id: 10597655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C42C920 for ; Wed, 12 Sep 2018 14:43:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BCBC2A2FA for ; Wed, 12 Sep 2018 14:43:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FEFC2A301; Wed, 12 Sep 2018 14:43:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BA562A2FA for ; Wed, 12 Sep 2018 14:43:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728132AbeILTs3 (ORCPT ); Wed, 12 Sep 2018 15:48:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:60530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726819AbeILTsZ (ORCPT ); Wed, 12 Sep 2018 15:48:25 -0400 Received: from localhost.localdomain (unknown [192.55.54.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 951FD20890; Wed, 12 Sep 2018 14:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536763416; bh=EriHvUk/yR9Afq8GoKBtaJSd+oeAPD3Ke+fYJniyAgs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zc1RIy4Zv481scJUOre8ooXRNw0LYfMuBhr6Ft32XUjPqAKuupPwcuuiJ5uXbqx4W gp+jFfLz/EI7fDO+DQc0Z2q9IndoUwImVH9pVhjIOgeCHBcnfpuNIUlc5doDxibK7s XrTDU00dQmDbsfmcN2OfEfORr76FlD4X62MO4n38= From: Alan Tull To: Greg Kroah-Hartman Cc: Moritz Fischer , Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [PATCH 5/5] fpga: dfl-fme-region: Use platform_get_drvdata() Date: Wed, 12 Sep 2018 09:43:27 -0500 Message-Id: <20180912144327.3130-6-atull@kernel.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180912144327.3130-1-atull@kernel.org> References: <20180912144327.3130-1-atull@kernel.org> Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Moritz Fischer Use platform_get_drvdata() in remove() function of the platform driver rather than dev_get_drvdata() to match the platform_set_drvdata in the probe(). Signed-off-by: Moritz Fischer Acked-by: Alan Tull --- drivers/fpga/dfl-fme-region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/dfl-fme-region.c b/drivers/fpga/dfl-fme-region.c index 51a5ac2..3fa0de2 100644 --- a/drivers/fpga/dfl-fme-region.c +++ b/drivers/fpga/dfl-fme-region.c @@ -66,7 +66,7 @@ static int fme_region_probe(struct platform_device *pdev) static int fme_region_remove(struct platform_device *pdev) { - struct fpga_region *region = dev_get_drvdata(&pdev->dev); + struct fpga_region *region = platform_get_drvdata(pdev); struct fpga_manager *mgr = region->mgr; fpga_region_unregister(region);