.. | .. |
---|
312 | 312 | } |
---|
313 | 313 | static DEVICE_ATTR_RW(otg_mode); |
---|
314 | 314 | |
---|
315 | | -static struct attribute *tahvo_attributes[] = { |
---|
| 315 | +static struct attribute *tahvo_attrs[] = { |
---|
316 | 316 | &dev_attr_vbus.attr, |
---|
317 | 317 | &dev_attr_otg_mode.attr, |
---|
318 | 318 | NULL |
---|
319 | 319 | }; |
---|
320 | | - |
---|
321 | | -static const struct attribute_group tahvo_attr_group = { |
---|
322 | | - .attrs = tahvo_attributes, |
---|
323 | | -}; |
---|
| 320 | +ATTRIBUTE_GROUPS(tahvo); |
---|
324 | 321 | |
---|
325 | 322 | static int tahvo_usb_probe(struct platform_device *pdev) |
---|
326 | 323 | { |
---|
.. | .. |
---|
398 | 395 | |
---|
399 | 396 | tu->irq = ret = platform_get_irq(pdev, 0); |
---|
400 | 397 | if (ret < 0) |
---|
401 | | - return ret; |
---|
| 398 | + goto err_remove_phy; |
---|
402 | 399 | ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt, |
---|
403 | 400 | IRQF_ONESHOT, |
---|
404 | 401 | "tahvo-vbus", tu); |
---|
.. | .. |
---|
408 | 405 | goto err_remove_phy; |
---|
409 | 406 | } |
---|
410 | 407 | |
---|
411 | | - /* Attributes */ |
---|
412 | | - ret = sysfs_create_group(&pdev->dev.kobj, &tahvo_attr_group); |
---|
413 | | - if (ret) { |
---|
414 | | - dev_err(&pdev->dev, "cannot create sysfs group: %d\n", ret); |
---|
415 | | - goto err_free_irq; |
---|
416 | | - } |
---|
417 | | - |
---|
418 | 408 | return 0; |
---|
419 | 409 | |
---|
420 | | -err_free_irq: |
---|
421 | | - free_irq(tu->irq, tu); |
---|
422 | 410 | err_remove_phy: |
---|
423 | 411 | usb_remove_phy(&tu->phy); |
---|
424 | 412 | err_disable_clk: |
---|
.. | .. |
---|
432 | 420 | { |
---|
433 | 421 | struct tahvo_usb *tu = platform_get_drvdata(pdev); |
---|
434 | 422 | |
---|
435 | | - sysfs_remove_group(&pdev->dev.kobj, &tahvo_attr_group); |
---|
436 | 423 | free_irq(tu->irq, tu); |
---|
437 | 424 | usb_remove_phy(&tu->phy); |
---|
438 | 425 | if (!IS_ERR(tu->ick)) |
---|
.. | .. |
---|
446 | 433 | .remove = tahvo_usb_remove, |
---|
447 | 434 | .driver = { |
---|
448 | 435 | .name = "tahvo-usb", |
---|
| 436 | + .dev_groups = tahvo_groups, |
---|
449 | 437 | }, |
---|
450 | 438 | }; |
---|
451 | 439 | module_platform_driver(tahvo_usb_driver); |
---|