提交 d13a280f 编写于 作者: G Greg Kroah-Hartman

USB: serial: convert bus code to use drv_groups

The drv_attrs field of struct bus_type is going away soon, drv_groups
should be used instead.  This converts the USB serial bus code to use
the correct field.
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 bf220695
...@@ -122,7 +122,7 @@ static int usb_serial_device_remove(struct device *dev) ...@@ -122,7 +122,7 @@ static int usb_serial_device_remove(struct device *dev)
return retval; return retval;
} }
static ssize_t store_new_id(struct device_driver *driver, static ssize_t new_id_store(struct device_driver *driver,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
...@@ -135,17 +135,19 @@ static ssize_t store_new_id(struct device_driver *driver, ...@@ -135,17 +135,19 @@ static ssize_t store_new_id(struct device_driver *driver,
return retval; return retval;
} }
static ssize_t show_dynids(struct device_driver *driver, char *buf) static ssize_t new_id_show(struct device_driver *driver, char *buf)
{ {
struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver); struct usb_serial_driver *usb_drv = to_usb_serial_driver(driver);
return usb_show_dynids(&usb_drv->dynids, buf); return usb_show_dynids(&usb_drv->dynids, buf);
} }
static DRIVER_ATTR_RW(new_id);
static struct driver_attribute drv_attrs[] = { static struct attribute *usb_serial_drv_attrs[] = {
__ATTR(new_id, S_IRUGO | S_IWUSR, show_dynids, store_new_id), &driver_attr_new_id.attr,
__ATTR_NULL, NULL,
}; };
ATTRIBUTE_GROUPS(usb_serial_drv);
static void free_dynids(struct usb_serial_driver *drv) static void free_dynids(struct usb_serial_driver *drv)
{ {
...@@ -164,7 +166,7 @@ struct bus_type usb_serial_bus_type = { ...@@ -164,7 +166,7 @@ struct bus_type usb_serial_bus_type = {
.match = usb_serial_device_match, .match = usb_serial_device_match,
.probe = usb_serial_device_probe, .probe = usb_serial_device_probe,
.remove = usb_serial_device_remove, .remove = usb_serial_device_remove,
.drv_attrs = drv_attrs, .drv_groups = usb_serial_drv_groups,
}; };
int usb_serial_bus_register(struct usb_serial_driver *driver) int usb_serial_bus_register(struct usb_serial_driver *driver)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册