usb: dwc3-of-simple: Stop using of_reset_control_array_get() directly
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 25 Jan 2024 11:29:08 +0000 (12:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 00:44:28 +0000 (16:44 -0800)
Use of_reset_control_array_get_optional_exclusive() instead, it is
implemented as:

  static inline struct reset_control *
  of_reset_control_array_get_optional_exclusive(struct device_node *node)
  {
          return of_reset_control_array_get(node, false, true, true);
  }

This makes the code easier to understand and removes the last remaining
direct use of of_reset_control_array_get(). No functional changes.

This change was made possible by commit f4cc91ddd856 ("usb: dwc3:
of-simple: remove Amlogic GXL and AXG compatibles"), which made the
parameters passed to of_reset_control_array_get() constant.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20240125-dwc3-of-simple-reset-control-array-fix-v2-1-1ab6b52cad21@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-of-simple.c

index d1539fc9eabdae5d572ab58986a457f877c0b065..9cf9ee1b637b7cb6365809f5542bd4edee185b5b 100644 (file)
@@ -52,8 +52,7 @@ static int dwc3_of_simple_probe(struct platform_device *pdev)
        if (of_device_is_compatible(np, "rockchip,rk3399-dwc3"))
                simple->need_reset = true;
 
-       simple->resets = of_reset_control_array_get(np, false, true,
-                                                   true);
+       simple->resets = of_reset_control_array_get_optional_exclusive(np);
        if (IS_ERR(simple->resets)) {
                ret = PTR_ERR(simple->resets);
                dev_err(dev, "failed to get device resets, err=%d\n", ret);