1 // SPDX-License-Identifier: GPL-2.0
3 * sysfs.c - MediaLB sysfs information
5 * Copyright (C) 2015, Microchip Technology Germany II GmbH & Co. KG
10 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
12 #include <linux/kernel.h>
14 #include <linux/device.h>
16 static ssize_t state_show(struct device *dev, struct device_attribute *attr,
19 bool state = dim2_sysfs_get_state_cb();
21 return sprintf(buf, "%s\n", state ? "locked" : "");
24 static DEVICE_ATTR_RO(state);
26 static struct attribute *dev_attrs[] = {
31 static struct attribute_group dev_attr_group = {
35 static const struct attribute_group *dev_attr_groups[] = {
40 int dim2_sysfs_probe(struct device *dev)
42 dev->groups = dev_attr_groups;
43 return device_register(dev);
46 void dim2_sysfs_destroy(struct device *dev)
48 device_unregister(dev);