Lines Matching refs:soc_dev

40 struct device *soc_device_to_device(struct soc_device *soc_dev)  in soc_device_to_device()  argument
42 return &soc_dev->dev; in soc_device_to_device()
50 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); in soc_attribute_mode() local
53 && (soc_dev->attr->machine != NULL)) in soc_attribute_mode()
56 && (soc_dev->attr->family != NULL)) in soc_attribute_mode()
59 && (soc_dev->attr->revision != NULL)) in soc_attribute_mode()
62 && (soc_dev->attr->soc_id != NULL)) in soc_attribute_mode()
73 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); in soc_info_get() local
76 return sprintf(buf, "%s\n", soc_dev->attr->machine); in soc_info_get()
78 return sprintf(buf, "%s\n", soc_dev->attr->family); in soc_info_get()
80 return sprintf(buf, "%s\n", soc_dev->attr->revision); in soc_info_get()
82 return sprintf(buf, "%s\n", soc_dev->attr->soc_id); in soc_info_get()
108 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); in soc_release() local
110 kfree(soc_dev); in soc_release()
115 struct soc_device *soc_dev; in soc_device_register() local
118 soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL); in soc_device_register()
119 if (!soc_dev) { in soc_device_register()
132 ret = ida_get_new(&soc_ida, &soc_dev->soc_dev_num); in soc_device_register()
140 soc_dev->attr = soc_dev_attr; in soc_device_register()
141 soc_dev->dev.bus = &soc_bus_type; in soc_device_register()
142 soc_dev->dev.groups = soc_attr_groups; in soc_device_register()
143 soc_dev->dev.release = soc_release; in soc_device_register()
145 dev_set_name(&soc_dev->dev, "soc%d", soc_dev->soc_dev_num); in soc_device_register()
147 ret = device_register(&soc_dev->dev); in soc_device_register()
151 return soc_dev; in soc_device_register()
154 ida_remove(&soc_ida, soc_dev->soc_dev_num); in soc_device_register()
156 kfree(soc_dev); in soc_device_register()
162 void soc_device_unregister(struct soc_device *soc_dev) in soc_device_unregister() argument
164 ida_remove(&soc_ida, soc_dev->soc_dev_num); in soc_device_unregister()
166 device_unregister(&soc_dev->dev); in soc_device_unregister()