forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/usb/host/bcma-hcd.c
....@@ -168,7 +168,7 @@
168168 }
169169 }
170170
171
-/**
171
+/*
172172 * bcma_hcd_usb20_old_arm_init - Initialize old USB 2.0 controller on ARM
173173 *
174174 * Old USB 2.0 core is identified as BCMA_CORE_USB20_HOST and was introduced
....@@ -261,7 +261,7 @@
261261 usleep_range(1000, 2000);
262262 }
263263
264
-/**
264
+/*
265265 * bcma_hcd_usb20_ns_init - Initialize Northstar USB 2.0 controller
266266 */
267267 static int bcma_hcd_usb20_ns_init(struct bcma_hcd_device *bcma_hcd)
....@@ -285,7 +285,7 @@
285285 {
286286 struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev);
287287
288
- if (IS_ERR_OR_NULL(usb_dev->gpio_desc))
288
+ if (!usb_dev->gpio_desc)
289289 return;
290290
291291 gpiod_set_value(usb_dev->gpio_desc, val);
....@@ -406,9 +406,11 @@
406406 return -ENOMEM;
407407 usb_dev->core = core;
408408
409
- if (core->dev.of_node)
410
- usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc",
411
- GPIOD_OUT_HIGH);
409
+ usb_dev->gpio_desc = devm_gpiod_get_optional(&core->dev, "vcc",
410
+ GPIOD_OUT_HIGH);
411
+ if (IS_ERR(usb_dev->gpio_desc))
412
+ return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc),
413
+ "error obtaining VCC GPIO");
412414
413415 switch (core->id.id) {
414416 case BCMA_CORE_USB20_HOST:
....@@ -495,15 +497,4 @@
495497 .suspend = bcma_hcd_suspend,
496498 .resume = bcma_hcd_resume,
497499 };
498
-
499
-static int __init bcma_hcd_init(void)
500
-{
501
- return bcma_driver_register(&bcma_hcd_driver);
502
-}
503
-module_init(bcma_hcd_init);
504
-
505
-static void __exit bcma_hcd_exit(void)
506
-{
507
- bcma_driver_unregister(&bcma_hcd_driver);
508
-}
509
-module_exit(bcma_hcd_exit);
500
+module_bcma_driver(bcma_hcd_driver);