Skip to content

Commit 07959ad

Browse files
krzkgregkh
authored andcommitted
USB: dwc3: Use syscon_regmap_lookup_by_phandle_args
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/20250212202913.23443-1-krzysztof.kozlowski@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 461f24b commit 07959ad

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

drivers/usb/dwc3/dwc3-am62.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,26 +153,18 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62)
153153
{
154154
struct device *dev = am62->dev;
155155
struct device_node *node = dev->of_node;
156-
struct of_phandle_args args;
157156
struct regmap *syscon;
158157
int ret;
159158

160-
syscon = syscon_regmap_lookup_by_phandle(node, "ti,syscon-phy-pll-refclk");
159+
syscon = syscon_regmap_lookup_by_phandle_args(node, "ti,syscon-phy-pll-refclk",
160+
1, &am62->offset);
161161
if (IS_ERR(syscon)) {
162162
dev_err(dev, "unable to get ti,syscon-phy-pll-refclk regmap\n");
163163
return PTR_ERR(syscon);
164164
}
165165

166166
am62->syscon = syscon;
167167

168-
ret = of_parse_phandle_with_fixed_args(node, "ti,syscon-phy-pll-refclk", 1,
169-
0, &args);
170-
if (ret)
171-
return ret;
172-
173-
of_node_put(args.np);
174-
am62->offset = args.args[0];
175-
176168
/* Core voltage. PHY_CORE_VOLTAGE bit Recommended to be 0 always */
177169
ret = regmap_update_bits(am62->syscon, am62->offset, PHY_CORE_VOLTAGE_MASK, 0);
178170
if (ret) {

0 commit comments

Comments
 (0)