Received: by 10.213.65.68 with SMTP id h4csp1014845imn; Tue, 27 Mar 2018 13:02:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+F81WNRQ5O+7HdLIUbydH1bYS0jVIXCCg2XrUAkn4fBL+RWnePz15y4bUs9SgEM/lR9crU X-Received: by 2002:a17:902:bc3:: with SMTP id 61-v6mr682969plr.398.1522180959242; Tue, 27 Mar 2018 13:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522180959; cv=none; d=google.com; s=arc-20160816; b=DiDdtbzv9uPXco2PhPIn2Z1VvxcBzxiHVL38PHdMXrId6OF7SU9HtvlUjjwF/ULgqM TkXvKbV051vkMMdF/nXaga7kETivk+PHtyC3HTPRaxOsggJTZh+NspswGnLcf7syNpK1 mpS37hjJuG+NG2+hq1Z2QQZsZtFGqWCvTTxjTVLdRNGd4SOCuiGmEjRmZQk5N7e7EDrX HktI1sNdhQp7I85fRegJdTUAWcFd18pThfgf+Ukds0XuVgAeHxNo9fvIf2sQVDach1pJ Pw12e81hDRRfqnZVMgfRi2BwnNzVsa7GPgMMG30GnkVomE5tdLOPv5bM3jpATVwXDfb3 QBfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:arc-authentication-results; bh=XuBa5aDWZzejLPxtu7svLZ2SGu4x9xnF4M3YfTbUlsQ=; b=Ggm9J1sltSwVBQuMOMp8koBWGV328GWjlIIlKUd1Mt1ookwZbVfHChABcenrYPGPgy SdyVwD1QFD52gD4umfODm7Q+pPHUUgCG6SNPs0mqEIjKQtJNdIaYaAd1BwgNBwTFTEQm Sc4elJbVd3aj6iKYLyDjDWD389tAYtB6OXaODqyigd/jM1QrgmGQ7zB3OQ6KyNPoKHLp UPLkqAQFMvxRn6mTqHdkJSTVnxqgK9rspAgUdf7ugtFn5V4wajoEHPW/tcAd0Mbxefpw cmgASBARaDN3O/OMwVXEmQZYnxGdw+NOgBOFVNn3iWDYRKYi0tg8UI+XalOMUPGEKInR JWQw== 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 o6si1322973pgf.658.2018.03.27.13.02.21; Tue, 27 Mar 2018 13:02:39 -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 S1751739AbeC0UAG (ORCPT + 99 others); Tue, 27 Mar 2018 16:00:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751008AbeC0UAE (ORCPT ); Tue, 27 Mar 2018 16:00:04 -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 D221B2175B; Tue, 27 Mar 2018 20:00:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D221B2175B 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 0/4] fpga: don't use drvdata in common code Date: Tue, 27 Mar 2018 14:59:53 -0500 Message-Id: <20180327195957.3878-1-atull@kernel.org> X-Mailer: git-send-email 2.14.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Setting drvdata is fine for DT based devices which have one manager, bridge, or region device per platform device. However, PCIe based devices may have multiple FPGA mgr/bridge/regions under one PCIe device. Without these changes, PCIe-based solutions have to create an extra device for each child mgr/bridge/region to hold drvdata. Also changing the fpga_*_register/unregister functions to take the corresponding struct as the only parameter wherever they weren't already. * int fpga_bridge_register(struct fpga_bridge *br) * int fpga_mgr_register(struct fpga_manager *mgr) * int fpga_region_register(struct fpga_region *region) * void fpga_bridge_unregister(struct fpga_bridge *br) * void fpga_mgr_unregister(struct fpga_manager *mgr) * int fpga_region_unregister(struct fpga_region *region) Changes from v2: * Drop patch 5 which fixed a DT overlay issue. The underlying issue was fixed in the main DT overlay code. * Minor code cleanup to make it more obvious that the changes were not breaking anything * Added Moritz' ack on patch 1 Alan Tull (4): fpga: region: don't use drvdata in common fpga code fpga: manager: don't use drvdata in common fpga code fpga: bridge: don't use drvdata in common fpga code fpga: region: change fpga_region_register to have one param Documentation/fpga/fpga-mgr.txt | 24 +++++++++++++++------ Documentation/fpga/fpga-region.txt | 3 +-- drivers/fpga/altera-cvp.c | 18 ++++++++++++---- drivers/fpga/altera-fpga2sdram.c | 20 +++++++++++++---- drivers/fpga/altera-freeze-bridge.c | 18 +++++++++++++--- drivers/fpga/altera-hps2fpga.c | 16 +++++++++++--- drivers/fpga/altera-pr-ip-core.c | 17 +++++++++++++-- drivers/fpga/altera-ps-spi.c | 18 +++++++++++++--- drivers/fpga/fpga-bridge.c | 43 ++++++++++++++----------------------- drivers/fpga/fpga-mgr.c | 39 ++++++++++++--------------------- drivers/fpga/fpga-region.c | 9 ++++++-- drivers/fpga/ice40-spi.c | 20 +++++++++++++---- drivers/fpga/of-fpga-region.c | 4 +++- drivers/fpga/socfpga-a10.c | 16 +++++++++++--- drivers/fpga/socfpga.c | 18 +++++++++++++--- drivers/fpga/ts73xx-fpga.c | 18 +++++++++++++--- drivers/fpga/xilinx-pr-decoupler.c | 15 ++++++++++--- drivers/fpga/xilinx-spi.c | 18 +++++++++++++--- drivers/fpga/zynq-fpga.c | 16 +++++++++++--- include/linux/fpga/fpga-bridge.h | 7 +++--- include/linux/fpga/fpga-mgr.h | 8 +++---- include/linux/fpga/fpga-region.h | 4 +++- 22 files changed, 256 insertions(+), 113 deletions(-) -- 2.14.2