Skip to content

Commit

Permalink
phy: stm32: fix usbphyc static checker and checkpatch warnings
Browse files Browse the repository at this point in the history
This patch fixes the following issues:
* warning reported by checkpatch:
WARNING: line over 80 characters
rockchip-linux#87: FILE: drivers/phy/st/phy-stm32-usbphyc.c:87:
+static void stm32_usbphyc_get_pll_params(u32 clk_rate, struct pll_params *pll_params)

* bug reported by static checker (Dan Carpenter):
drivers/phy/st/phy-stm32-usbphyc.c:371 stm32_usbphyc_probe()
error: uninitialized symbol 'i'.

* unused stm32_usbphyc structure member: bool pll_enabled.

* unnecessary extra line in stm32_usbphyc_of_xlate

Fixes: 94c358d "phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)"
Signed-off-by: Amelie Delaunay <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
  • Loading branch information
ADESTM authored and kishon committed May 20, 2018
1 parent f7f50b2 commit 52113be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/phy/st/phy-stm32-usbphyc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ struct stm32_usbphyc {
struct stm32_usbphyc_phy **phys;
int nphys;
int switch_setup;
bool pll_enabled;
};

static inline void stm32_usbphyc_set_bits(void __iomem *reg, u32 bits)
Expand All @@ -84,7 +83,8 @@ static inline void stm32_usbphyc_clr_bits(void __iomem *reg, u32 bits)
writel_relaxed(readl_relaxed(reg) & ~bits, reg);
}

static void stm32_usbphyc_get_pll_params(u32 clk_rate, struct pll_params *pll_params)
static void stm32_usbphyc_get_pll_params(u32 clk_rate,
struct pll_params *pll_params)
{
unsigned long long fvco, ndiv, frac;

Expand Down Expand Up @@ -271,7 +271,6 @@ static struct phy *stm32_usbphyc_of_xlate(struct device *dev,
struct stm32_usbphyc *usbphyc = dev_get_drvdata(dev);
struct stm32_usbphyc_phy *usbphyc_phy = NULL;
struct device_node *phynode = args->np;

int port = 0;

for (port = 0; port < usbphyc->nphys; port++) {
Expand Down Expand Up @@ -367,8 +366,8 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
if (IS_ERR(phy)) {
ret = PTR_ERR(phy);
if (ret != -EPROBE_DEFER)
dev_err(dev,
"failed to create phy%d: %d\n", i, ret);
dev_err(dev, "failed to create phy%d: %d\n",
port, ret);
goto put_child;
}

Expand Down

0 comments on commit 52113be

Please sign in to comment.