linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Tull <atull@kernel.org>
To: Moritz Fischer <mdf@kernel.org>, Anatolij Gustschin <agust@denx.de>
Cc: Alan Tull <atull@kernel.org>,
	linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org
Subject: [PATCH 0/2] fpga: add attribute groups
Date: Tue, 22 Aug 2017 10:53:53 -0500	[thread overview]
Message-ID: <20170822155355.3896-1-atull@kernel.org> (raw)

Make it easy to add device attribute groups when registering an FPGA
manager, bridge, or region.  This way, the sysfs attributes are added
in device_add instead of afterwards which can lead to race
conditions [1].

Patch 1: add groups to the structs that are used when a manager, bridge,
or region is registered.

Patch 2: changes to altera cvp FPGA manager to use this method of
registering.

I've tested this method on platform devices.  Patch 2 builds but is
untested.

This patchset is dependent on my "non-dt support" patchset currently
under review.

[1] http://www.kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly/

Alan Tull (2):
  fpga: add attribute groups
  fpga: altera-cvp: register attribute groups using ops

 drivers/fpga/altera-cvp.c        | 39 +++++++++++++++++++--------------------
 drivers/fpga/fpga-bridge.c       |  1 +
 drivers/fpga/fpga-mgr.c          |  1 +
 drivers/fpga/fpga-region.c       |  1 +
 include/linux/fpga/fpga-bridge.h |  2 ++
 include/linux/fpga/fpga-mgr.h    |  2 ++
 include/linux/fpga/fpga-region.h |  2 ++
 7 files changed, 28 insertions(+), 20 deletions(-)

-- 
2.7.4

             reply	other threads:[~2017-08-22 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 15:53 Alan Tull [this message]
2017-08-22 15:53 ` [PATCH 1/2] fpga: add attribute groups Alan Tull
2017-08-22 15:53 ` [PATCH 2/2] fpga: altera-cvp: register attribute groups using ops Alan Tull
2017-08-22 20:23   ` Alan Tull
2017-08-23 17:54     ` Alan Tull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170822155355.3896-1-atull@kernel.org \
    --to=atull@kernel.org \
    --cc=agust@denx.de \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).