#include <linux/spinlock.h>
#include <linux/sys_soc.h>
static DEFINE_IDA(soc_ida);
static ssize_t soc_info_get(struct device *dev,
struct device_attribute *attr,
struct soc_device_attribute *attr;
static struct bus_type soc_bus_type = {
static DEVICE_ATTR(machine, S_IRUGO, soc_info_get, NULL);
static DEVICE_ATTR(family, S_IRUGO, soc_info_get, NULL);
static DEVICE_ATTR(soc_id, S_IRUGO, soc_info_get, NULL);
static DEVICE_ATTR(revision, S_IRUGO, soc_info_get, NULL);
struct device *soc_device_to_device(struct soc_device *soc_dev)
static umode_t soc_attribute_mode(struct kobject *kobj,
struct device *dev = container_of(kobj, struct device, kobj);
struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
if ((attr == &dev_attr_machine.attr)
&& (soc_dev->attr->machine != NULL))
if ((attr == &dev_attr_family.attr)
&& (soc_dev->attr->family != NULL))
if ((attr == &dev_attr_revision.attr)
&& (soc_dev->attr->revision != NULL))
if ((attr == &dev_attr_soc_id.attr)
&& (soc_dev->attr->soc_id != NULL))