Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e64f223 authored by Alex Dubov's avatar Alex Dubov Committed by Pierre Ossman
Browse files

tifm: add sysfs attribute for tifm devices



A sysfs attribute reflecting current media type is added.

Signed-off-by: default avatarAlex Dubov <oakad@yahoo.com>
Signed-off-by: default avatarPierre Ossman <drzeus@drzeus.cx>
parent 88de1b2f
Loading
Loading
Loading
Loading
+20 −7
Original line number Original line Diff line number Diff line
@@ -142,8 +142,21 @@ 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",
	.dev_attrs      = tifm_dev_attrs,
	.match          = tifm_bus_match,
	.match          = tifm_bus_match,
	.uevent         = tifm_uevent,
	.uevent         = tifm_uevent,
	.probe          = tifm_device_probe,
	.probe          = tifm_device_probe,