Re: bus_type->dev_attrs not properly thought out

From: Greg KH
Date: Sat Sep 18 2004 - 10:59:58 EST


On Sat, Sep 18, 2004 at 10:43:41AM -0500, Dmitry Torokhov wrote:
> What's wrong with the following (drivers/input/serio/serio.c):
>
> static struct device_attribute serio_device_attrs[] = {
> __ATTR(description, S_IRUGO, serio_show_description, NULL),

You should use __ATTR_RO() for that one :)

> __ATTR(driver, S_IWUSR | S_IRUGO, serio_show_driver, serio_rebind_driver),
> __ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode),
> __ATTR_NULL
> };
>
> Pretty compact and expressive IMHO.

Yes, that's the way to currently do it. Russell, is that acceptable?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/