Skip to content

Commit 757d2e6

Browse files
committed
Merge tag 'phy-fixes-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-linus
Vinod writes: phy: fixes for 5.13 Phy driver fixes for few drivers: cadence, mtk-tphy, sparx5, wiz mostly fixing error code and checking return codes etc * tag 'phy-fixes-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: Sparx5 Eth SerDes: check return value after calling platform_get_resource() phy: ralink: phy-mt7621-pci: drop 'of_match_ptr' to fix -Wunused-const-variable phy: ti: Fix an error code in wiz_probe() phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init() phy: cadence: Sierra: Fix error return code in cdns_sierra_phy_probe() phy: usb: Fix misuse of IS_ENABLED
2 parents 8124c8a + d1ce245 commit 757d2e6

File tree

6 files changed

+11
-3
lines changed

6 files changed

+11
-3
lines changed

drivers/phy/broadcom/phy-brcm-usb-init.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static inline u32 brcm_usb_readl(void __iomem *addr)
7878
* Other architectures (e.g., ARM) either do not support big endian, or
7979
* else leave I/O in little endian mode.
8080
*/
81-
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(__BIG_ENDIAN))
81+
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
8282
return __raw_readl(addr);
8383
else
8484
return readl_relaxed(addr);
@@ -87,7 +87,7 @@ static inline u32 brcm_usb_readl(void __iomem *addr)
8787
static inline void brcm_usb_writel(u32 val, void __iomem *addr)
8888
{
8989
/* See brcmnand_readl() comments */
90-
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(__BIG_ENDIAN))
90+
if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
9191
__raw_writel(val, addr);
9292
else
9393
writel_relaxed(val, addr);

drivers/phy/cadence/phy-cadence-sierra.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev)
940940
sp->nsubnodes = node;
941941

942942
if (sp->num_lanes > SIERRA_MAX_LANES) {
943+
ret = -EINVAL;
943944
dev_err(dev, "Invalid lane configuration\n");
944945
goto put_child2;
945946
}

drivers/phy/mediatek/phy-mtk-tphy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,8 @@ static int mtk_phy_init(struct phy *phy)
949949
break;
950950
default:
951951
dev_err(tphy->dev, "incompatible PHY type\n");
952+
clk_disable_unprepare(instance->ref_clk);
953+
clk_disable_unprepare(instance->da_ref_clk);
952954
return -EINVAL;
953955
}
954956

drivers/phy/microchip/sparx5_serdes.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,6 +2470,10 @@ static int sparx5_serdes_probe(struct platform_device *pdev)
24702470
priv->coreclock = clock;
24712471

24722472
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2473+
if (!iores) {
2474+
dev_err(priv->dev, "Invalid resource\n");
2475+
return -EINVAL;
2476+
}
24732477
iomem = devm_ioremap(priv->dev, iores->start, resource_size(iores));
24742478
if (IS_ERR(iomem)) {
24752479
dev_err(priv->dev, "Unable to get serdes registers: %s\n",

drivers/phy/ralink/phy-mt7621-pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static struct platform_driver mt7621_pci_phy_driver = {
341341
.probe = mt7621_pci_phy_probe,
342342
.driver = {
343343
.name = "mt7621-pci-phy",
344-
.of_match_table = of_match_ptr(mt7621_pci_phy_ids),
344+
.of_match_table = mt7621_pci_phy_ids,
345345
},
346346
};
347347

drivers/phy/ti/phy-j721e-wiz.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,7 @@ static int wiz_probe(struct platform_device *pdev)
12121212

12131213
if (wiz->typec_dir_delay < WIZ_TYPEC_DIR_DEBOUNCE_MIN ||
12141214
wiz->typec_dir_delay > WIZ_TYPEC_DIR_DEBOUNCE_MAX) {
1215+
ret = -EINVAL;
12151216
dev_err(dev, "Invalid typec-dir-debounce property\n");
12161217
goto err_addr_to_resource;
12171218
}

0 commit comments

Comments
 (0)