Skip to content

Commit 95e5905

Browse files
xiaoleiwang123456vinodkoul
authored andcommitted
phy: freescale: Initialize priv->lock
Initialize priv->lock to fix the following warning. WARNING: CPU: 0 PID: 12 at kernel/locking/mutex.c:577 __mutex_lock+0x70c/0x8b8 Modules linked in: Hardware name: Freescale i.MX8QM MEK (DT) Call trace: __mutex_lock+0x70c/0x8b8 (P) mutex_lock_nested+0x24/0x30 imx_hsio_power_on+0x4c/0x764 phy_power_on+0x7c/0x12c imx_pcie_host_init+0x1d0/0x4d4 dw_pcie_host_init+0x188/0x4b0 imx_pcie_probe+0x324/0x6f4 platform_probe+0x5c/0x98 really_probe+0xbc/0x29c __driver_probe_device+0x78/0x12c driver_probe_device+0xd8/0x160 __device_attach_driver+0xb8/0x138 bus_for_each_drv+0x84/0xe4 __device_attach_async_helper+0xb8/0xdc async_run_entry_fn+0x34/0xe0 process_one_work+0x220/0x694 worker_thread+0x1c0/0x36c kthread+0x14c/0x224 Fixes: 82c56b6 ("phy: freescale: imx8qm-hsio: Add i.MX8QM HSIO PHY driver support") Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patch.msgid.link/20250925013806.569658-1-xiaolei.wang@windriver.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent ec58145 commit 95e5905

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/phy/freescale/phy-fsl-imx8qm-hsio.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static struct phy *imx_hsio_xlate(struct device *dev,
533533

534534
static int imx_hsio_probe(struct platform_device *pdev)
535535
{
536-
int i;
536+
int i, ret;
537537
void __iomem *off;
538538
struct device *dev = &pdev->dev;
539539
struct device_node *np = dev->of_node;
@@ -545,6 +545,9 @@ static int imx_hsio_probe(struct platform_device *pdev)
545545
return -ENOMEM;
546546
priv->dev = &pdev->dev;
547547
priv->drvdata = of_device_get_match_data(dev);
548+
ret = devm_mutex_init(dev, &priv->lock);
549+
if (ret)
550+
return ret;
548551

549552
/* Get HSIO configuration mode */
550553
if (of_property_read_string(np, "fsl,hsio-cfg", &priv->hsio_cfg))

0 commit comments

Comments
 (0)