]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/phy/phy-am335x-control.c
Merge tag 'v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux...
[karo-tx-linux.git] / drivers / usb / phy / phy-am335x-control.c
index df3e1ba5013cdd9cffdc20e8a1b0b4366faac0d4..3bff7a8b6a816e22e55a43af9f2d1d97d2eee99b 100644 (file)
@@ -126,6 +126,9 @@ struct phy_control *am335x_get_phy_control(struct device *dev)
                return NULL;
 
        dev = bus_find_device(&platform_bus_type, NULL, node, match);
+       if (!dev)
+               return NULL;
+
        ctrl_usb = dev_get_drvdata(dev);
        if (!ctrl_usb)
                return NULL;
@@ -150,10 +153,8 @@ static int am335x_control_usb_probe(struct platform_device *pdev)
        phy_ctrl = of_id->data;
 
        ctrl_usb = devm_kzalloc(&pdev->dev, sizeof(*ctrl_usb), GFP_KERNEL);
-       if (!ctrl_usb) {
-               dev_err(&pdev->dev, "unable to alloc memory for control usb\n");
+       if (!ctrl_usb)
                return -ENOMEM;
-       }
 
        ctrl_usb->dev = &pdev->dev;
 
@@ -185,7 +186,6 @@ static struct platform_driver am335x_control_driver = {
        .remove         = am335x_control_usb_remove,
        .driver         = {
                .name   = "am335x-control-usb",
-               .owner  = THIS_MODULE,
                .of_match_table = omap_control_usb_id_table,
        },
 };