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.
___
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 presented
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_att
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),
- __ATTR_RO(routes)