bus.c (c93b76b34b4d8dbe8e3443eb27e49ac60034342b) bus.c (007d64eb2232b91aa86b51abc1742936807e0bd4)
1/*
2 * Intel Management Engine Interface (Intel MEI) Linux driver
3 * Copyright (c) 2012-2013, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *

--- 100 unchanged lines hidden (view full) ---

109 dev->driver = NULL;
110
111 return 0;
112 }
113
114 return driver->remove(device);
115}
116
1/*
2 * Intel Management Engine Interface (Intel MEI) Linux driver
3 * Copyright (c) 2012-2013, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *

--- 100 unchanged lines hidden (view full) ---

109 dev->driver = NULL;
110
111 return 0;
112 }
113
114 return driver->remove(device);
115}
116
117static ssize_t name_show(struct device *dev, struct device_attribute *a,
118 char *buf)
119{
120 struct mei_cl_device *device = to_mei_cl_device(dev);
121 size_t len;
122
123 len = snprintf(buf, PAGE_SIZE, "%s", device->name);
124
125 return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
126}
127static DEVICE_ATTR_RO(name);
128
129static ssize_t uuid_show(struct device *dev, struct device_attribute *a,
130 char *buf)
131{
132 struct mei_cl_device *device = to_mei_cl_device(dev);
133 const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
134 size_t len;
135
136 len = snprintf(buf, PAGE_SIZE, "%pUl", uuid);
137
138 return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
139}
140static DEVICE_ATTR_RO(uuid);
141
117static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
118 char *buf)
119{
120 struct mei_cl_device *device = to_mei_cl_device(dev);
121 const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
122 size_t len;
123
124 len = snprintf(buf, PAGE_SIZE, "mei:%s:" MEI_CL_UUID_FMT ":",
125 device->name, MEI_CL_UUID_ARGS(uuid->b));
126
127 return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
128}
129static DEVICE_ATTR_RO(modalias);
130
131static struct attribute *mei_cl_dev_attrs[] = {
142static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
143 char *buf)
144{
145 struct mei_cl_device *device = to_mei_cl_device(dev);
146 const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
147 size_t len;
148
149 len = snprintf(buf, PAGE_SIZE, "mei:%s:" MEI_CL_UUID_FMT ":",
150 device->name, MEI_CL_UUID_ARGS(uuid->b));
151
152 return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
153}
154static DEVICE_ATTR_RO(modalias);
155
156static struct attribute *mei_cl_dev_attrs[] = {
157 &dev_attr_name.attr,
158 &dev_attr_uuid.attr,
132 &dev_attr_modalias.attr,
133 NULL,
134};
135ATTRIBUTE_GROUPS(mei_cl_dev);
136
137static int mei_cl_uevent(struct device *dev, struct kobj_uevent_env *env)
138{
139 struct mei_cl_device *device = to_mei_cl_device(dev);
140 const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
141
159 &dev_attr_modalias.attr,
160 NULL,
161};
162ATTRIBUTE_GROUPS(mei_cl_dev);
163
164static int mei_cl_uevent(struct device *dev, struct kobj_uevent_env *env)
165{
166 struct mei_cl_device *device = to_mei_cl_device(dev);
167 const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
168
169 if (add_uevent_var(env, "MEI_CL_UUID=%pUl", uuid))
170 return -ENOMEM;
171
172 if (add_uevent_var(env, "MEI_CL_NAME=%s", device->name))
173 return -ENOMEM;
174
142 if (add_uevent_var(env, "MODALIAS=mei:%s:" MEI_CL_UUID_FMT ":",
143 device->name, MEI_CL_UUID_ARGS(uuid->b)))
144 return -ENOMEM;
145
146 return 0;
147}
148
149static struct bus_type mei_cl_bus_type = {

--- 426 unchanged lines hidden ---
175 if (add_uevent_var(env, "MODALIAS=mei:%s:" MEI_CL_UUID_FMT ":",
176 device->name, MEI_CL_UUID_ARGS(uuid->b)))
177 return -ENOMEM;
178
179 return 0;
180}
181
182static struct bus_type mei_cl_bus_type = {

--- 426 unchanged lines hidden ---