mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 09:34:17 +00:00
tifm: add sysfs attribute for tifm devices
A sysfs attribute reflecting current media type is added. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
This commit is contained in:
parent
88de1b2fed
commit
4e64f22385
@ -142,14 +142,27 @@ static int tifm_device_resume(struct device *dev)
|
|||||||
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
|
static ssize_t type_show(struct device *dev, struct device_attribute *attr,
|
||||||
|
char *buf)
|
||||||
|
{
|
||||||
|
struct tifm_dev *sock = container_of(dev, struct tifm_dev, dev);
|
||||||
|
return sprintf(buf, "%x", sock->type);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct device_attribute tifm_dev_attrs[] = {
|
||||||
|
__ATTR(type, S_IRUGO, type_show, NULL),
|
||||||
|
__ATTR_NULL
|
||||||
|
};
|
||||||
|
|
||||||
static struct bus_type tifm_bus_type = {
|
static struct bus_type tifm_bus_type = {
|
||||||
.name = "tifm",
|
.name = "tifm",
|
||||||
.match = tifm_bus_match,
|
.dev_attrs = tifm_dev_attrs,
|
||||||
.uevent = tifm_uevent,
|
.match = tifm_bus_match,
|
||||||
.probe = tifm_device_probe,
|
.uevent = tifm_uevent,
|
||||||
.remove = tifm_device_remove,
|
.probe = tifm_device_probe,
|
||||||
.suspend = tifm_device_suspend,
|
.remove = tifm_device_remove,
|
||||||
.resume = tifm_device_resume
|
.suspend = tifm_device_suspend,
|
||||||
|
.resume = tifm_device_resume
|
||||||
};
|
};
|
||||||
|
|
||||||
static void tifm_free(struct class_device *cdev)
|
static void tifm_free(struct class_device *cdev)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user