.. | .. |
---|
316 | 316 | MYDEV_ATTR_SIMPLE_UNSIGNED(mode_msb, update_display_mode); |
---|
317 | 317 | MYDEV_ATTR_SIMPLE_UNSIGNED(mode_lsb, update_display_mode); |
---|
318 | 318 | |
---|
319 | | -static struct attribute *dev_attrs[] = { |
---|
| 319 | +static struct attribute *sevseg_attrs[] = { |
---|
320 | 320 | &dev_attr_powered.attr, |
---|
321 | 321 | &dev_attr_text.attr, |
---|
322 | 322 | &dev_attr_textmode.attr, |
---|
.. | .. |
---|
325 | 325 | &dev_attr_mode_lsb.attr, |
---|
326 | 326 | NULL |
---|
327 | 327 | }; |
---|
328 | | - |
---|
329 | | -static const struct attribute_group dev_attr_grp = { |
---|
330 | | - .attrs = dev_attrs, |
---|
331 | | -}; |
---|
| 328 | +ATTRIBUTE_GROUPS(sevseg); |
---|
332 | 329 | |
---|
333 | 330 | static int sevseg_probe(struct usb_interface *interface, |
---|
334 | 331 | const struct usb_device_id *id) |
---|
.. | .. |
---|
354 | 351 | mydev->mode_msb = 0x06; /* 6 characters */ |
---|
355 | 352 | mydev->mode_lsb = 0x3f; /* scanmode for 6 chars */ |
---|
356 | 353 | |
---|
357 | | - rc = sysfs_create_group(&interface->dev.kobj, &dev_attr_grp); |
---|
358 | | - if (rc) |
---|
359 | | - goto error; |
---|
360 | | - |
---|
361 | 354 | dev_info(&interface->dev, "USB 7 Segment device now attached\n"); |
---|
362 | 355 | return 0; |
---|
363 | 356 | |
---|
364 | | -error: |
---|
365 | | - usb_set_intfdata(interface, NULL); |
---|
366 | | - usb_put_dev(mydev->udev); |
---|
367 | | - kfree(mydev); |
---|
368 | 357 | error_mem: |
---|
369 | 358 | return rc; |
---|
370 | 359 | } |
---|
.. | .. |
---|
374 | 363 | struct usb_sevsegdev *mydev; |
---|
375 | 364 | |
---|
376 | 365 | mydev = usb_get_intfdata(interface); |
---|
377 | | - sysfs_remove_group(&interface->dev.kobj, &dev_attr_grp); |
---|
378 | 366 | usb_set_intfdata(interface, NULL); |
---|
379 | 367 | usb_put_dev(mydev->udev); |
---|
380 | 368 | kfree(mydev); |
---|
.. | .. |
---|
423 | 411 | .resume = sevseg_resume, |
---|
424 | 412 | .reset_resume = sevseg_reset_resume, |
---|
425 | 413 | .id_table = id_table, |
---|
| 414 | + .dev_groups = sevseg_groups, |
---|
426 | 415 | .supports_autosuspend = 1, |
---|
427 | 416 | }; |
---|
428 | 417 | |
---|