Skip to contentSkip to conversation

phy: core: fix code style in devm_of_phy_provider_unregister

PATCH In review Vinod Koul 1 participant 5 messages Jun 29, 2020 – Jul 8, 2020 Generic PHY framework

lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

PATCH 1/4 phy: core: fix code style in devm_of_phy_provider_unregister

Documentation/process/coding-style.rst says:
"functions: they have the opening brace at the beginning of the next line"

devm_of_phy_provider_unregister() function has opening brace at same line, so fix it up.

---
 drivers/phy/phy-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/phy/phy-core.c +2 -1
index a27b8d578d7f..b54522f06245 100644
@@ -1122,7 +1122,8 @@ EXPORT_SYMBOL_GPL(of_phy_provider_unregister);
  * of_phy_provider_unregister to unregister the phy provider.
  */
 void devm_of_phy_provider_unregister(struct device *dev,
-	struct phy_provider *phy_provider) {
+	struct phy_provider *phy_provider)
+{
 	int r;
 
 	r = devres_destroy(dev, devm_phy_provider_release, devm_phy_match,
Signature · 1 line
2.26.2
author maintainer
#1 lore raw

PATCH 2/4 phy: core: Document function args

Some function arguments are missing from documentation prompting validation kernel doc script to complain:

drivers/phy/phy-core.c:1078: warning: Function parameter or member 'children' not described in '__devm_of_phy_provider_register' drivers/phy/phy-core.c:1125: warning: Function parameter or member 'phy_provider' not described in 'devm_of_phy_provider_unregister'

Add the documentation for these

---
 drivers/phy/phy-core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/phy/phy-core.c +2 -0
index b54522f06245..71cb10826326 100644
@@ -1062,6 +1062,7 @@ EXPORT_SYMBOL_GPL(__of_phy_provider_register);
  * __devm_of_phy_provider_register() - create/register phy provider with the
  * framework
  * @dev: struct device of the phy provider
+ * @children: device node containing children (if different from dev->of_node)
  * @owner: the module owner containing of_xlate
  * @of_xlate: function pointer to obtain phy instance from phy provider
  *
@@ -1117,6 +1118,7 @@ EXPORT_SYMBOL_GPL(of_phy_provider_unregister);
 /**
  * devm_of_phy_provider_unregister() - remove phy provider from the framework
  * @dev: struct device of the phy provider
+ * @phy_provider: phy provider returned by of_phy_provider_register()
  *
  * destroys the devres associated with this phy provider and invokes
  * of_phy_provider_unregister to unregister the phy provider.
Signature · 1 line
2.26.2
author maintainer
#2 lore raw

PATCH 3/4 phy: ti: dm816x: remove set but unused variable

In reply to Vinod Koul

dm816x_usb_phy_init() sets variable 'error' but never uses it, so remove it.

drivers/phy/ti/phy-dm816x-usb.c:85:6: warning: variable ‘error’ set but not used [-Wunused-but-set-variable]

---
 drivers/phy/ti/phy-dm816x-usb.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/phy/ti/phy-dm816x-usb.c +5 -6
index 26f194779064..57adc08a89b2 100644
@@ -82,17 +82,16 @@ static int dm816x_usb_phy_init(struct phy *x)
 {
 	struct dm816x_usb_phy *phy = phy_get_drvdata(x);
 	unsigned int val;
-	int error;
 
 	if (clk_get_rate(phy->refclk) != 24000000)
 		dev_warn(phy->dev, "nonstandard phy refclk\n");
 
 	/* Set PLL ref clock and put phys to sleep */
-	error = regmap_update_bits(phy->syscon, phy->usb_ctrl,
-				   DM816X_USB_CTRL_PHYCLKSRC |
-				   DM816X_USB_CTRL_PHYSLEEP1 |
-				   DM816X_USB_CTRL_PHYSLEEP0,
-				   0);
+	regmap_update_bits(phy->syscon, phy->usb_ctrl,
+			   DM816X_USB_CTRL_PHYCLKSRC |
+			   DM816X_USB_CTRL_PHYSLEEP1 |
+			   DM816X_USB_CTRL_PHYSLEEP0,
+			   0);
 	regmap_read(phy->syscon, phy->usb_ctrl, &val);
 	if ((val & 3) != 0)
 		dev_info(phy->dev,
Signature · 1 line
2.26.2
author maintainer
#3 lore raw

PATCH 4/4 phy: ti-pipe3: remove set but unused variable

In reply to Vinod Koul

ti_pipe3_power_on() sets variable 'ret' but never uses it, so remove it.

drivers/phy/ti/phy-ti-pipe3.c:340:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

---
 drivers/phy/ti/phy-ti-pipe3.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/phy/ti/phy-ti-pipe3.c +2 -3
index a87946589eb7..e9332c90f75f 100644
@@ -337,7 +337,6 @@ static int ti_pipe3_power_on(struct phy *x)
 {
 	u32 val;
 	u32 mask;
-	int ret;
 	unsigned long rate;
 	struct ti_pipe3 *phy = phy_get_drvdata(x);
 	bool rx_pending = false;
@@ -355,8 +354,8 @@ static int ti_pipe3_power_on(struct phy *x)
 	rate = rate / 1000000;
 	mask = OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_MASK;
 	val = rate << OMAP_CTRL_PIPE3_PHY_PWRCTL_CLK_FREQ_SHIFT;
-	ret = regmap_update_bits(phy->phy_power_syscon, phy->power_reg,
-				 mask, val);
+	regmap_update_bits(phy->phy_power_syscon, phy->power_reg,
+			   mask, val);
 	/*
 	 * For PCIe, TX and RX must be powered on simultaneously.
 	 * For USB and SATA, TX must be powered on before RX
Signature · 1 line
2.26.2
author maintainer
#4 lore raw
In reply to Vinod Koul
Quoted 6 lines · Vinod Koul

Documentation/process/coding-style.rst says:
"functions: they have the opening brace at the beginning of the next line"

devm_of_phy_provider_unregister() function has opening brace at same line, so fix it up.

Applied all these

Signature · 1 line
~Vinod