mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Acked-by: Moritz Fischer <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
84e93f1d4f
commit
845089bbf5
6 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -569,6 +569,7 @@ int fpga_mgr_register(struct device *dev, const char *name,
|
|||
|
||||
device_initialize(&mgr->dev);
|
||||
mgr->dev.class = fpga_mgr_class;
|
||||
mgr->dev.groups = mops->groups;
|
||||
mgr->dev.parent = dev;
|
||||
mgr->dev.of_node = dev->of_node;
|
||||
mgr->dev.id = id;
|
||||
|
|
|
|||
|
|
@ -173,6 +173,7 @@ int fpga_region_register(struct device *dev, struct fpga_region *region)
|
|||
mutex_init(®ion->mutex);
|
||||
INIT_LIST_HEAD(®ion->bridge_list);
|
||||
device_initialize(®ion->dev);
|
||||
region->dev.groups = region->groups;
|
||||
region->dev.class = fpga_region_class;
|
||||
region->dev.parent = dev;
|
||||
region->dev.of_node = dev->of_node;
|
||||
|
|
|
|||
Loading…
Reference in a new issue