lkml.org 
[lkml]   [2010]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/9] RapidIO: Add switch-specific sysfs initialization callback
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),
> __ATTR_NULL,
> };
>
> +static DEVICE_ATTR(routes, S_IRUGO, routes_show, NULL);
> +

This seems a separate change from the sw_sysfs? Why make it separate?

> */
> struct rio_switch {
> @@ -256,6 +257,7 @@ struct rio_switch {
> u8 *sw_domain);
> int (*em_init) (struct rio_dev *dev);
> int (*em_handle) (struct rio_dev *dev, u8 swport);
> + int (*sw_sysfs) (struct rio_dev *dev, int create);
> struct rio_dev *nextdev[0];
> };

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)';

Micha


\
 
 \ /
  Last update: 2010-08-16 14:29    [from the cache]
©2003-2011 Jasper Spaans