forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/drivers/usb/phy/phy-tahvo.c
....@@ -312,15 +312,12 @@
312312 }
313313 static DEVICE_ATTR_RW(otg_mode);
314314
315
-static struct attribute *tahvo_attributes[] = {
315
+static struct attribute *tahvo_attrs[] = {
316316 &dev_attr_vbus.attr,
317317 &dev_attr_otg_mode.attr,
318318 NULL
319319 };
320
-
321
-static const struct attribute_group tahvo_attr_group = {
322
- .attrs = tahvo_attributes,
323
-};
320
+ATTRIBUTE_GROUPS(tahvo);
324321
325322 static int tahvo_usb_probe(struct platform_device *pdev)
326323 {
....@@ -398,7 +395,7 @@
398395
399396 tu->irq = ret = platform_get_irq(pdev, 0);
400397 if (ret < 0)
401
- return ret;
398
+ goto err_remove_phy;
402399 ret = request_threaded_irq(tu->irq, NULL, tahvo_usb_vbus_interrupt,
403400 IRQF_ONESHOT,
404401 "tahvo-vbus", tu);
....@@ -408,17 +405,8 @@
408405 goto err_remove_phy;
409406 }
410407
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
-
418408 return 0;
419409
420
-err_free_irq:
421
- free_irq(tu->irq, tu);
422410 err_remove_phy:
423411 usb_remove_phy(&tu->phy);
424412 err_disable_clk:
....@@ -432,7 +420,6 @@
432420 {
433421 struct tahvo_usb *tu = platform_get_drvdata(pdev);
434422
435
- sysfs_remove_group(&pdev->dev.kobj, &tahvo_attr_group);
436423 free_irq(tu->irq, tu);
437424 usb_remove_phy(&tu->phy);
438425 if (!IS_ERR(tu->ick))
....@@ -446,6 +433,7 @@
446433 .remove = tahvo_usb_remove,
447434 .driver = {
448435 .name = "tahvo-usb",
436
+ .dev_groups = tahvo_groups,
449437 },
450438 };
451439 module_platform_driver(tahvo_usb_driver);