Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364799
b: refs/heads/master
c: 81ef672
h: refs/heads/master
i:
  364797: 244fd6c
  364795: 43bcfb4
  364791: 7e89702
  364783: 577dd05
  364767: b3dce04
  364735: 8697e02
  364671: fca8e84
  364543: 0e4ad2a
v: v3
  • Loading branch information
Fabio Baltieri authored and Felipe Balbi committed Apr 3, 2013
1 parent 9abd84e commit f421e71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ee1f2e6e51581d5cb9c312161a9a9b2f18f25bf
refs/heads/master: 81ef6724302e0c7ba3f087403de24760601b1839
19 changes: 5 additions & 14 deletions trunk/drivers/usb/phy/phy-ab8500-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,15 +628,13 @@ static int ab8500_usb_probe(struct platform_device *pdev)
return -ENODEV;
}

ab = kzalloc(sizeof *ab, GFP_KERNEL);
ab = devm_kzalloc(&pdev->dev, sizeof(*ab), GFP_KERNEL);
if (!ab)
return -ENOMEM;

otg = kzalloc(sizeof *otg, GFP_KERNEL);
if (!otg) {
kfree(ab);
otg = devm_kzalloc(&pdev->dev, sizeof(*otg), GFP_KERNEL);
if (!otg)
return -ENOMEM;
}

ab->dev = &pdev->dev;
ab->ab8500 = ab8500;
Expand Down Expand Up @@ -665,12 +663,12 @@ static int ab8500_usb_probe(struct platform_device *pdev)

err = ab8500_usb_irq_setup(pdev, ab);
if (err < 0)
goto fail;
return err;

err = usb_add_phy(&ab->phy, USB_PHY_TYPE_USB2);
if (err) {
dev_err(&pdev->dev, "Can't register transceiver\n");
goto fail;
return err;
}

/* Needed to enable ID detection. */
Expand All @@ -679,10 +677,6 @@ static int ab8500_usb_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "revision 0x%2x driver initialized\n", rev);

return 0;
fail:
kfree(otg);
kfree(ab);
return err;
}

static int ab8500_usb_remove(struct platform_device *pdev)
Expand All @@ -700,9 +694,6 @@ static int ab8500_usb_remove(struct platform_device *pdev)

platform_set_drvdata(pdev, NULL);

kfree(ab->phy.otg);
kfree(ab);

return 0;
}

Expand Down

0 comments on commit f421e71

Please sign in to comment.