Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: phy-rockchip-inno-usb2: Perform trivial code cleanups

Perform a few trivial code cleanups, e.g. to obey the reverse Christmas tree
rule, to avoid use of "{ ... }" code blocks where they aren't really needed,
or to avoid line wrapping by using the 100-column width better.

No intended functional changes are introduced by these code cleanups.

Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Link: https://lore.kernel.org/r/adce7309f6fd9e1191c53bab552a8531d1a71216.1725524802.git.dsimic@manjaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Dragan Simic and committed by
Vinod Koul
449d2a52 d3712b35

+9 -17
+9 -17
drivers/phy/rockchip/phy-rockchip-inno-usb2.c
··· 418 418 419 419 static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy) 420 420 { 421 - int ret; 422 421 struct device_node *node = rphy->dev->of_node; 423 422 struct extcon_dev *edev; 423 + int ret; 424 424 425 425 if (of_property_read_bool(node, "extcon")) { 426 426 edev = extcon_get_edev_by_phandle(rphy->dev, 0); ··· 1327 1327 struct rockchip_usb2phy *rphy; 1328 1328 const struct rockchip_usb2phy_cfg *phy_cfgs; 1329 1329 unsigned int reg; 1330 - int index, ret; 1330 + int index = 0, ret; 1331 1331 1332 1332 rphy = devm_kzalloc(dev, sizeof(*rphy), GFP_KERNEL); 1333 1333 if (!rphy) ··· 1339 1339 dev_err(dev, "failed to locate usbgrf\n"); 1340 1340 return PTR_ERR(rphy->grf); 1341 1341 } 1342 - } 1343 - 1344 - else { 1342 + } else { 1345 1343 rphy->grf = syscon_node_to_regmap(dev->parent->of_node); 1346 1344 if (IS_ERR(rphy->grf)) 1347 1345 return PTR_ERR(rphy->grf); ··· 1356 1358 } 1357 1359 1358 1360 if (of_property_read_u32_index(np, "reg", 0, &reg)) { 1359 - dev_err(dev, "the reg property is not assigned in %pOFn node\n", 1360 - np); 1361 + dev_err(dev, "the reg property is not assigned in %pOFn node\n", np); 1361 1362 return -EINVAL; 1362 1363 } 1363 1364 1364 1365 /* support address_cells=2 */ 1365 1366 if (of_property_count_u32_elems(np, "reg") > 2 && reg == 0) { 1366 1367 if (of_property_read_u32_index(np, "reg", 1, &reg)) { 1367 - dev_err(dev, "the reg property is not assigned in %pOFn node\n", 1368 - np); 1368 + dev_err(dev, "the reg property is not assigned in %pOFn node\n", np); 1369 1369 return -EINVAL; 1370 1370 } 1371 1371 } ··· 1382 1386 if (ret) 1383 1387 return ret; 1384 1388 1385 - /* find out a proper config which can be matched with dt. */ 1386 - index = 0; 1389 + /* find a proper config that can be matched with the DT */ 1387 1390 do { 1388 1391 if (phy_cfgs[index].reg == reg) { 1389 1392 rphy->phy_cfg = &phy_cfgs[index]; ··· 1402 1407 return PTR_ERR(rphy->phy_reset); 1403 1408 1404 1409 rphy->clk = devm_clk_get_optional_enabled(dev, "phyclk"); 1405 - if (IS_ERR(rphy->clk)) { 1410 + if (IS_ERR(rphy->clk)) 1406 1411 return dev_err_probe(&pdev->dev, PTR_ERR(rphy->clk), 1407 1412 "failed to get phyclk\n"); 1408 - } 1409 1413 1410 1414 ret = rockchip_usb2phy_clk480m_register(rphy); 1411 1415 if (ret) { ··· 1440 1446 1441 1447 /* initialize otg/host port separately */ 1442 1448 if (of_node_name_eq(child_np, "host-port")) { 1443 - ret = rockchip_usb2phy_host_port_init(rphy, rport, 1444 - child_np); 1449 + ret = rockchip_usb2phy_host_port_init(rphy, rport, child_np); 1445 1450 if (ret) 1446 1451 goto put_child; 1447 1452 } else { 1448 - ret = rockchip_usb2phy_otg_port_init(rphy, rport, 1449 - child_np); 1453 + ret = rockchip_usb2phy_otg_port_init(rphy, rport, child_np); 1450 1454 if (ret) 1451 1455 goto put_child; 1452 1456 }