lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 3 Oct 2018 18:03:11 +0530
From:   Anurag Kumar Vulisha <anurag.kumar.vulisha@...inx.com>
To:     <mathias.nyman@...el.com>, <gregkh@...uxfoundation.org>
CC:     <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <v.anuragkumar@...il.com>, <apandey@...inx.com>,
        Anurag Kumar Vulisha <anurag.kumar.vulisha@...inx.com>
Subject: [PATCH] usb: host: xhci: Find usb-phy by phandle if of_node not supported

There are use cases where the usb phy is created at runtime and
added into sysdev (for example phy-generic.c creates the usb phy
during probe and adds the phy to phy list using usb_add_phy_dev).
In this case, the sysdev may not have the "usb-phy" phandle added.
So, the existing devm_usb_get_phy_by_phandle() doesn't find the
"usb-phy" and returns -ENODEV. This patch modifies the code to search
for usb phy in of_node if "usb-phy" phandle is not found in sysdev.

Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@...inx.com>
---
 drivers/usb/host/xhci-plat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 94e9392..997836f 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -293,6 +293,10 @@ static int xhci_plat_probe(struct platform_device *pdev)
 	}
 
 	hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev, "usb-phy", 0);
+	if (PTR_ERR(hcd->usb_phy) == -ENODEV)
+		hcd->usb_phy =
+			devm_usb_get_phy_by_node(sysdev, sysdev->of_node, 0);
+
 	if (IS_ERR(hcd->usb_phy)) {
 		ret = PTR_ERR(hcd->usb_phy);
 		if (ret == -EPROBE_DEFER)
-- 
2.1.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ