Commit 6074bc0c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'phy-for-4.15-rc_v2' of...

Merge tag 'phy-for-4.15-rc_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus

Kishon writes:

phy: for 4.15 -rc

 *) Fix device-tree node lookups in tegra xusb
 *) Fix platform_get_irq_byname's error checking in cpcap-usb phy driver
 *) Fix in rockchip-typec phy driver to balance pm_runtime_enable/disable
 *) Fix compiler error in rcar-gen3-usb2 phy when USB is disabled
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parents 1291a0d5 2b88212c
...@@ -310,7 +310,7 @@ static int cpcap_usb_init_irq(struct platform_device *pdev, ...@@ -310,7 +310,7 @@ static int cpcap_usb_init_irq(struct platform_device *pdev,
int irq, error; int irq, error;
irq = platform_get_irq_byname(pdev, name); irq = platform_get_irq_byname(pdev, name);
if (!irq) if (irq < 0)
return -ENODEV; return -ENODEV;
error = devm_request_threaded_irq(ddata->dev, irq, NULL, error = devm_request_threaded_irq(ddata->dev, irq, NULL,
......
...@@ -12,7 +12,9 @@ config PHY_RCAR_GEN3_USB2 ...@@ -12,7 +12,9 @@ config PHY_RCAR_GEN3_USB2
tristate "Renesas R-Car generation 3 USB 2.0 PHY driver" tristate "Renesas R-Car generation 3 USB 2.0 PHY driver"
depends on ARCH_RENESAS depends on ARCH_RENESAS
depends on EXTCON depends on EXTCON
depends on USB_SUPPORT
select GENERIC_PHY select GENERIC_PHY
select USB_COMMON
help help
Support for USB 2.0 PHY found on Renesas R-Car generation 3 SoCs. Support for USB 2.0 PHY found on Renesas R-Car generation 3 SoCs.
......
...@@ -1137,6 +1137,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) ...@@ -1137,6 +1137,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
if (IS_ERR(phy)) { if (IS_ERR(phy)) {
dev_err(dev, "failed to create phy: %s\n", dev_err(dev, "failed to create phy: %s\n",
child_np->name); child_np->name);
pm_runtime_disable(dev);
return PTR_ERR(phy); return PTR_ERR(phy);
} }
...@@ -1146,6 +1147,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) ...@@ -1146,6 +1147,7 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev)
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
if (IS_ERR(phy_provider)) { if (IS_ERR(phy_provider)) {
dev_err(dev, "Failed to register phy provider\n"); dev_err(dev, "Failed to register phy provider\n");
pm_runtime_disable(dev);
return PTR_ERR(phy_provider); return PTR_ERR(phy_provider);
} }
......
...@@ -75,14 +75,14 @@ MODULE_DEVICE_TABLE(of, tegra_xusb_padctl_of_match); ...@@ -75,14 +75,14 @@ MODULE_DEVICE_TABLE(of, tegra_xusb_padctl_of_match);
static struct device_node * static struct device_node *
tegra_xusb_find_pad_node(struct tegra_xusb_padctl *padctl, const char *name) tegra_xusb_find_pad_node(struct tegra_xusb_padctl *padctl, const char *name)
{ {
/* struct device_node *pads, *np;
* of_find_node_by_name() drops a reference, so make sure to grab one.
*/
struct device_node *np = of_node_get(padctl->dev->of_node);
np = of_find_node_by_name(np, "pads"); pads = of_get_child_by_name(padctl->dev->of_node, "pads");
if (np) if (!pads)
np = of_find_node_by_name(np, name); return NULL;
np = of_get_child_by_name(pads, name);
of_node_put(pads);
return np; return np;
} }
...@@ -90,16 +90,16 @@ tegra_xusb_find_pad_node(struct tegra_xusb_padctl *padctl, const char *name) ...@@ -90,16 +90,16 @@ tegra_xusb_find_pad_node(struct tegra_xusb_padctl *padctl, const char *name)
static struct device_node * static struct device_node *
tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index) tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index)
{ {
/* struct device_node *np, *lanes;
* of_find_node_by_name() drops a reference, so make sure to grab one.
*/
struct device_node *np = of_node_get(pad->dev.of_node);
np = of_find_node_by_name(np, "lanes"); lanes = of_get_child_by_name(pad->dev.of_node, "lanes");
if (!np) if (!lanes)
return NULL; return NULL;
return of_find_node_by_name(np, pad->soc->lanes[index].name); np = of_get_child_by_name(lanes, pad->soc->lanes[index].name);
of_node_put(lanes);
return np;
} }
static int static int
...@@ -195,7 +195,7 @@ int tegra_xusb_pad_register(struct tegra_xusb_pad *pad, ...@@ -195,7 +195,7 @@ int tegra_xusb_pad_register(struct tegra_xusb_pad *pad,
unsigned int i; unsigned int i;
int err; int err;
children = of_find_node_by_name(pad->dev.of_node, "lanes"); children = of_get_child_by_name(pad->dev.of_node, "lanes");
if (!children) if (!children)
return -ENODEV; return -ENODEV;
...@@ -444,21 +444,21 @@ static struct device_node * ...@@ -444,21 +444,21 @@ static struct device_node *
tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type, tegra_xusb_find_port_node(struct tegra_xusb_padctl *padctl, const char *type,
unsigned int index) unsigned int index)
{ {
/* struct device_node *ports, *np;
* of_find_node_by_name() drops a reference, so make sure to grab one.
*/
struct device_node *np = of_node_get(padctl->dev->of_node);
np = of_find_node_by_name(np, "ports");
if (np) {
char *name; char *name;
ports = of_get_child_by_name(padctl->dev->of_node, "ports");
if (!ports)
return NULL;
name = kasprintf(GFP_KERNEL, "%s-%u", type, index); name = kasprintf(GFP_KERNEL, "%s-%u", type, index);
if (!name) if (!name) {
of_node_put(ports);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
np = of_find_node_by_name(np, name);
kfree(name);
} }
np = of_get_child_by_name(ports, name);
kfree(name);
of_node_put(ports);
return np; return np;
} }
...@@ -847,7 +847,7 @@ static void tegra_xusb_remove_ports(struct tegra_xusb_padctl *padctl) ...@@ -847,7 +847,7 @@ static void tegra_xusb_remove_ports(struct tegra_xusb_padctl *padctl)
static int tegra_xusb_padctl_probe(struct platform_device *pdev) static int tegra_xusb_padctl_probe(struct platform_device *pdev)
{ {
struct device_node *np = of_node_get(pdev->dev.of_node); struct device_node *np = pdev->dev.of_node;
const struct tegra_xusb_padctl_soc *soc; const struct tegra_xusb_padctl_soc *soc;
struct tegra_xusb_padctl *padctl; struct tegra_xusb_padctl *padctl;
const struct of_device_id *match; const struct of_device_id *match;
...@@ -855,7 +855,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev) ...@@ -855,7 +855,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
int err; int err;
/* for backwards compatibility with old device trees */ /* for backwards compatibility with old device trees */
np = of_find_node_by_name(np, "pads"); np = of_get_child_by_name(np, "pads");
if (!np) { if (!np) {
dev_warn(&pdev->dev, "deprecated DT, using legacy driver\n"); dev_warn(&pdev->dev, "deprecated DT, using legacy driver\n");
return tegra_xusb_padctl_legacy_probe(pdev); return tegra_xusb_padctl_legacy_probe(pdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment