Bounine, Alexandre wrote:
Why not make a sw_sysfs_create and sw_sysfs_remove? Is better for
readability. Now you call 'sw_sysfs(dev, 0)' or 'sw_sysfs(dev, 1)';
I just do not want to have an extra member here. Not every switch will
require own sysfs attributes, but every switch will be
Micha Nelissen wrote:
It's not problematic, but personally I find function calls that pass 0
or 1 as an argument hard to read. Likewise for boolean parameters. An
alternative would be to have defines SW_SYSFS_CREATE etc. It's a minor
item.
I will add defines.
Alexandre Bounine wrote:
- if (!rdev-rswitch)
- goto out;
-
Is it safe? All devices have a switch?
@@ -63,10 +59,11 @@ struct device_attribute rio_dev_attrs[] = {
__ATTR_RO(asm_did),
__ATTR_RO(asm_vid),
__ATTR_RO(asm_rev),
-
Micha Nelissen wrote:
Alexandre Bounine wrote:
- if (!rdev-rswitch)
- goto out;
-
Is it safe? All devices have a switch?
Yes. Because end-points should not have the routes attribute at all
(corrected by this patch).
@@ -63,10 +59,11 @@ struct device_attribute
Add callback that allows to create/remove switch-specific sysfs attributes.
Signed-off-by: Alexandre Bounine alexandre.boun...@idt.com
Reviewed-by: Thomas Moll thomas.m...@sysgo.com
Cc: Matt Porter mpor...@kernel.crashing.org
Cc: Li Yang le...@freescale.com
Cc: Kumar Gala