fpga: add attribute groups

Make it easy to add attributes to low level FPGA drivers the right
way.  Add attribute groups pointers to structures that are used when
registering a manager, bridge, or group.  When the low level driver
registers, set the device attribute group.  The attributes are
created in device_add.

Signed-off-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alan Tull 2017-11-15 14:20:28 -06:00 committed by Greg Kroah-Hartman
commit 845089bbf5
6 changed files with 9 additions and 0 deletions

View file

@ -367,6 +367,7 @@ int fpga_bridge_register(struct device *dev, const char *name,
bridge->priv = priv;
device_initialize(&bridge->dev);
bridge->dev.groups = br_ops->groups;
bridge->dev.class = fpga_bridge_class;
bridge->dev.parent = dev;
bridge->dev.of_node = dev->of_node;