Received: by 10.213.65.68 with SMTP id h4csp1015966imn; Tue, 27 Mar 2018 13:03:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/30r24gpd2WDMzwA6tUTOvnUDwmMMOr8F+vH+CpQQ2BArK6jrpJrDraK5YBVYYzGqI6mSc X-Received: by 10.99.97.16 with SMTP id v16mr494417pgb.104.1522181030873; Tue, 27 Mar 2018 13:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522181030; cv=none; d=google.com; s=arc-20160816; b=SL2ciO9xcWp8S/77jY9r0FoOl7afhOG2qntWiM/DYB31Vg6aIux8CrTw7ZxhZ04GsM ABqVTDpRE7lX9spLWVgYXRwo7AmDVDD/lioBy6CQg40LCfWbB0vavJgPponY6D5mJWza 4DYNMKOKRgYMM0gtQlOHYdmBrNej3PC39Mm0he8ybuejtzF8AtpkrpHzHHJp2l5VJt6Z sYT34zFuCd8dMDJoSAVXCa4vvFxL/7Rw0qFlhbhphBnjLpWsBIx0q8lZ59u3F7OvuZi4 JYnvGKs1CwtcLNh3ZDG95DKwYS9U43kWuf99UwAOgPl0YQXp78F9CWbGsGuPZfYrKO9m +6zA== 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:dmarc-filter:arc-authentication-results; bh=go4qjFKPwSQa6w1ui0qorz89NvDYb+t6YCvu/AH/Vyc=; b=Pp/oYJIDcWL/4X2C/xlV0Vwyc7B7Vng4OTdCx+hHdysg+eS7SEu1mISp0iai8ugNaL el4HVnaCzOFHoWJasfpWyeHn6kOAAIlqjx8krUt2fpaNEwVfBrJf74Rb1oJaodtpdie/ zXIJoZ1BA5B/Z69Y7Vu4bK6bR4S3dexffI1yJjWNpidsFHzs816d3OeFFa4EnIlw+O7+ JJeepeTF0N4NdcwOaZc4FcJ+Q07bfnHanxM5HmUtCKykYhYhvcPmRrkwkQndXPftvYJH EbMpEx4L7mT46y6k8qtdf/tXiHRXs7CwVaD6+4hO1iduGCkuq5ipmnTsS/VVCgcyOq+q /UFw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v9-v6si2049493plz.79.2018.03.27.13.03.36; Tue, 27 Mar 2018 13:03:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbeC0UA4 (ORCPT + 99 others); Tue, 27 Mar 2018 16:00:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:57078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbeC0UAF (ORCPT ); Tue, 27 Mar 2018 16:00:05 -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 40446217DF; Tue, 27 Mar 2018 20:00:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40446217DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=atull@kernel.org From: Alan Tull To: Moritz Fischer Cc: Anatolij Gustschin , Matthew Gerlach , Joel Holdsworth , Florian Fainelli , Joshua Clayton , Dinh Nguyen , Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [RESEND PATCH v3 1/4] fpga: region: don't use drvdata in common fpga code Date: Tue, 27 Mar 2018 14:59:54 -0500 Message-Id: <20180327195957.3878-2-atull@kernel.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180327195957.3878-1-atull@kernel.org> References: <20180327195957.3878-1-atull@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Part of patchset that changes the following fpga_*_register functions to not set drvdata: * fpga_region_register. * fpga_mgr_register * fpga_bridge_register The rationale is that setting drvdata is fine for DT based devices that will have one manager, bridge, or region per platform device. However PCIe based devices may have multiple FPGA mgr/bridge/regions under one PCIe device. Without these changes, the PCIe solution has to create an extra device for each child mgr/bridge/region to hold drvdata. Signed-off-by: Alan Tull Reported-by: Jiuyue Ma Acked-by: Moritz Fischer --- v2: No change to this patch in v2 of patchset v3: Add Moritz' ack --- 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 edab2a2e03ef..ebe1f872810d 100644 --- a/drivers/fpga/fpga-region.c +++ b/drivers/fpga/fpga-region.c @@ -178,7 +178,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"); -- 2.14.2