lkml.org 
[lkml]   [2014]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectCan I use DEVICE_INT_ATTR() so that probing and removing sysfs enteries happens automatically?
From
What is the proper way to use the 'DEVICE_(INT|ULONG|BOOL)_ATTR()'
macros with a platform driver? Or, am I best using per attribute pairs
of show/store functions?

If I code my own 'show()' and 'store()' functions and use the
'DEVICE_ATTR()' macros things work happily with an assignment of
'struct attribute_group * attr_groups[];' to the 'struct
device_driver' 'groups' field. i.e.

static struct platform_driver platform = { /* ... */ .driver = {
.groups = attr_groups, /* ... */ }, };

If I use the 'DEVICE_INT_ATTR()' macro (for
'device_(show|store)_int()' utility) the attribute appears in sysfs,
but accesses cause an OOPs: 'device_show_int()' is called via
'drv_attr_show()' with an inappropriate signature.

Whats a correct/corrected approach?

- Jamie


\
 
 \ /
  Last update: 2014-07-08 08:02    [W:0.050 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site