lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAGi9MxXckC4NrQudjSP3qKteV1Vo-gATmsiRTxRMp1DR1y_ONg@mail.gmail.com>
Date:	Tue, 8 Jul 2014 01:17:02 -0400
From:	Jamie Risk <jamie@...ject2risk.com>
To:	linux-kernel@...r.kernel.org
Cc:	Jamie Risk <jamie@...ject2risk.com>
Subject: Can I use DEVICE_INT_ATTR() so that probing and removing sysfs
 enteries happens automatically?

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ