Lines Matching refs:elog

32 	ssize_t (*show)(struct elog_obj *elog, struct elog_attribute *attr,
34 ssize_t (*store)(struct elog_obj *elog, struct elog_attribute *attr,
100 struct elog_obj *elog; in elog_attr_show() local
103 elog = to_elog_obj(kobj); in elog_attr_show()
108 return attribute->show(elog, attribute, buf); in elog_attr_show()
116 struct elog_obj *elog; in elog_attr_store() local
119 elog = to_elog_obj(kobj); in elog_attr_store()
124 return attribute->store(elog, attribute, buf, len); in elog_attr_store()
134 struct elog_obj *elog; in elog_release() local
136 elog = to_elog_obj(kobj); in elog_release()
137 kfree(elog->buffer); in elog_release()
138 kfree(elog); in elog_release()
163 struct elog_obj *elog = to_elog_obj(kobj); in raw_attr_read() local
166 if (!elog->buffer) { in raw_attr_read()
167 elog->buffer = kzalloc(elog->size, GFP_KERNEL); in raw_attr_read()
168 if (!elog->buffer) in raw_attr_read()
171 opal_rc = opal_read_elog(__pa(elog->buffer), in raw_attr_read()
172 elog->size, elog->id); in raw_attr_read()
175 elog->id); in raw_attr_read()
176 kfree(elog->buffer); in raw_attr_read()
177 elog->buffer = NULL; in raw_attr_read()
182 memcpy(buffer, elog->buffer + pos, count); in raw_attr_read()
189 struct elog_obj *elog; in create_elog_obj() local
192 elog = kzalloc(sizeof(*elog), GFP_KERNEL); in create_elog_obj()
193 if (!elog) in create_elog_obj()
196 elog->kobj.kset = elog_kset; in create_elog_obj()
198 kobject_init(&elog->kobj, &elog_ktype); in create_elog_obj()
200 sysfs_bin_attr_init(&elog->raw_attr); in create_elog_obj()
202 elog->raw_attr.attr.name = "raw"; in create_elog_obj()
203 elog->raw_attr.attr.mode = 0400; in create_elog_obj()
204 elog->raw_attr.size = size; in create_elog_obj()
205 elog->raw_attr.read = raw_attr_read; in create_elog_obj()
207 elog->id = id; in create_elog_obj()
208 elog->size = size; in create_elog_obj()
209 elog->type = type; in create_elog_obj()
211 elog->buffer = kzalloc(elog->size, GFP_KERNEL); in create_elog_obj()
213 if (elog->buffer) { in create_elog_obj()
214 rc = opal_read_elog(__pa(elog->buffer), in create_elog_obj()
215 elog->size, elog->id); in create_elog_obj()
218 elog->id); in create_elog_obj()
219 kfree(elog->buffer); in create_elog_obj()
220 elog->buffer = NULL; in create_elog_obj()
224 rc = kobject_add(&elog->kobj, NULL, "0x%llx", id); in create_elog_obj()
226 kobject_put(&elog->kobj); in create_elog_obj()
245 kobject_get(&elog->kobj); in create_elog_obj()
246 rc = sysfs_create_bin_file(&elog->kobj, &elog->raw_attr); in create_elog_obj()
248 kobject_uevent(&elog->kobj, KOBJ_ADD); in create_elog_obj()
251 kobject_put(&elog->kobj); in create_elog_obj()
255 kobject_put(&elog->kobj); in create_elog_obj()