#include <linux/sysfs.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/stat.h>
#include <linux/slab.h>
#include <linux/idr.h>
#include <linux/spinlock.h>
#include <linux/sys_soc.h>
#include <linux/err.h>
#include <linux/glob.h>
static DEFINE_IDA(soc_ida);
static ssize_t soc_info_show(struct device *dev, struct device_attribute *attr,
char *buf);
struct soc_device { … };
static const struct bus_type soc_bus_type = …;
static bool soc_bus_registered;
static DEVICE_ATTR(machine, 0444, soc_info_show, NULL);
static DEVICE_ATTR(family, 0444, soc_info_show, NULL);
static DEVICE_ATTR(serial_number, 0444, soc_info_show, NULL);
static DEVICE_ATTR(soc_id, 0444, soc_info_show, NULL);
static DEVICE_ATTR(revision, 0444, soc_info_show, NULL);
struct device *soc_device_to_device(struct soc_device *soc_dev)
{ … }
static umode_t soc_attribute_mode(struct kobject *kobj,
struct attribute *attr,
int index)
{ … }
static ssize_t soc_info_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static struct attribute *soc_attr[] = …;
static const struct attribute_group soc_attr_group = …;
static void soc_release(struct device *dev)
{ … }
static void soc_device_get_machine(struct soc_device_attribute *soc_dev_attr)
{ … }
static struct soc_device_attribute *early_soc_dev_attr;
struct soc_device *soc_device_register(struct soc_device_attribute *soc_dev_attr)
{ … }
EXPORT_SYMBOL_GPL(…);
void soc_device_unregister(struct soc_device *soc_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init soc_bus_register(void)
{ … }
core_initcall(soc_bus_register);
static int soc_device_match_attr(const struct soc_device_attribute *attr,
const struct soc_device_attribute *match)
{ … }
static int soc_device_match_one(struct device *dev, void *arg)
{ … }
const struct soc_device_attribute *soc_device_match(
const struct soc_device_attribute *matches)
{ … }
EXPORT_SYMBOL_GPL(…);