From patchwork Fri Apr 27 01:26:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 10367295 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A359560386 for ; Fri, 27 Apr 2018 01:28:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 921F7292BD for ; Fri, 27 Apr 2018 01:28:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 861F9292C1; Fri, 27 Apr 2018 01:28:18 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5603B292BD for ; Fri, 27 Apr 2018 01:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=4SLk7KyMauiLPTuD3dEnX9Am7dHpFaww0jezgyFN3JU=; b=iu+zufDeUX+VN1V6KXeQ+kTr1+ dfvLbE7Y0/EQj8JIWpa72tksa4IXrlx6Xs/gkvDYSEDRIIN1xo6C0Y2VaulIiux91EBcx4OFVyu+I YtvisybCyNJhPv3+NxgocEp9WQToNFB31uVXFZWp1Tma+UccydrEZshzonZRPpMuotQd0q7geanK7 GL3xq0QZDLSE3eLRbEt/dhOFfhzsRLcNASQtZBelgk2EkSIWMA0LVRH/s9bFKBs/5OzNPu+zdOHQR dg/T3iLith91oJ4XsRUYKigyagHJ98gs9C5hlVFtuKy4Z+du93N9ZYGKI8Ow3DZ4jgat0Sq/xAbgC LzBvbZTg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fBsBC-0001w6-NF; Fri, 27 Apr 2018 01:28:06 +0000 Received: from mail-ot0-f194.google.com ([74.125.82.194]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fBs9Z-0001BJ-I5 for linux-arm-kernel@lists.infradead.org; Fri, 27 Apr 2018 01:26:26 +0000 Received: by mail-ot0-f194.google.com with SMTP id p2-v6so308777otf.3 for ; Thu, 26 Apr 2018 18:26:14 -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; bh=U9IKzmjGPggyRJ/ezvgFGiVGz17y84H4pFdYSxoUzMY=; b=APCPEL1FbUs+VtMiWjsHGP3BRsasrec8iWnWIbepyk8s65e0OZYi0T8BkeRezik+O1 BUQOuY3oUh+vzkWQZBKTG5H8fRBM4AYMACTCF0H5yT5w7PU0F//uhBeL8RGGCO4sM5X9 kDHVIwIddDXyUuKJxUx24i1EQ5bStWJJrEN9hrXzDAngmxGi9iJj03uTmmd/Ywf7zH0s /S1vZ9TYPwGGQOTRr1FONsRTW54kHzuBZTsPxxHm4gcBRVciavE1jhb0Wyd2cfDTygi2 ZJemeXKrlz5o5DpN4SJWjLmHtVzTqD8Kqe6viboZrPQvCo/DMi57cChpq8kDTRMT6flG 1QyA== X-Gm-Message-State: ALQs6tAUp+/PVwIqGwlWPBSC3WanmF+XYFJClZd/RBDKShJCOEPxBGRR qGSg+B6wCYsmjrn8z3jNZ8Ss2g== X-Google-Smtp-Source: AB8JxZpOBDXgOaZN3bBXEVOmIv+nnLe/lSEeTDD5YdyhNYKCgsur85NeSr46aZyfmdJ+uwo0ZEhFeg== X-Received: by 2002:a9d:3f49:: with SMTP id m67-v6mr212883otc.133.1524792374224; Thu, 26 Apr 2018 18:26:14 -0700 (PDT) Received: from localhost ([130.164.62.82]) by smtp.gmail.com with ESMTPSA id g23-v6sm132338otc.73.2018.04.26.18.26.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 18:26:12 -0700 (PDT) From: Moritz Fischer To: linux-kernel@vger.kernel.org Subject: [PATCH 1/4] fpga: region: don't use drvdata in common fpga code Date: Thu, 26 Apr 2018 18:26:02 -0700 Message-Id: <20180427012605.28981-2-mdf@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427012605.28981-1-mdf@kernel.org> References: <20180427012605.28981-1-mdf@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180426_182625_604294_97B24903 X-CRM114-Status: GOOD ( 14.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: corbet@lwn.net, linux-fpga@vger.kernel.org, atull@kernel.org, linux-doc@vger.kernel.org, michal.simek@xilinx.com, Moritz Fischer , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alan Tull Changes to fpga_region_register function to not set drvdata. Setting drvdata is fine for DT based devices that will have one region per platform device. However PCIe based devices may have multiple FPGA regions under one PCIe device. Without these changes, the PCIe solution has to create an extra device for each child region to hold drvdata. Signed-off-by: Alan Tull Reported-by: Jiuyue Ma Signed-off-by: Moritz Fischer --- drivers/fpga/fpga-region.c | 1 - drivers/fpga/of-fpga-region.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index cb0603e07ff8..f634a8ed5e2c 100644 --- a/drivers/fpga/fpga-region.c +++ b/drivers/fpga/fpga-region.c @@ -183,7 +183,6 @@ int fpga_region_register(struct device *dev, struct fpga_region *region) region->dev.parent = dev; region->dev.of_node = dev->of_node; region->dev.id = id; - dev_set_drvdata(dev, region); ret = dev_set_name(®ion->dev, "region%d", id); if (ret) diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c index 119ff75522f1..35e7e8c4a0cb 100644 --- a/drivers/fpga/of-fpga-region.c +++ b/drivers/fpga/of-fpga-region.c @@ -438,6 +438,7 @@ static int of_fpga_region_probe(struct platform_device *pdev) goto eprobe_mgr_put; of_platform_populate(np, fpga_region_of_match, NULL, ®ion->dev); + dev_set_drvdata(dev, region); dev_info(dev, "FPGA Region probed\n");