Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364525
b: refs/heads/master
c: e4d7dc6
h: refs/heads/master
i:
  364523: 8c274ce
v: v3
  • Loading branch information
Roger Quadros authored and Felipe Balbi committed Mar 18, 2013
1 parent f67dab3 commit 1cc2671
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 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: 1f0972f5b05a674d73e4eb314fa1b6c78e37aef1
refs/heads/master: e4d7dc6674efd798792adbd689986cde5422aa62
17 changes: 5 additions & 12 deletions trunk/drivers/usb/otg/nop-usb-xceiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
enum usb_phy_type type = USB_PHY_TYPE_USB2;
int err;

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

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

if (pdata)
type = pdata->type;
Expand All @@ -127,18 +126,14 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
if (err) {
dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
err);
goto exit;
return err;
}

platform_set_drvdata(pdev, nop);

ATOMIC_INIT_NOTIFIER_HEAD(&nop->phy.notifier);

return 0;
exit:
kfree(nop->phy.otg);
kfree(nop);
return err;
}

static int nop_usb_xceiv_remove(struct platform_device *pdev)
Expand All @@ -148,8 +143,6 @@ static int nop_usb_xceiv_remove(struct platform_device *pdev)
usb_remove_phy(&nop->phy);

platform_set_drvdata(pdev, NULL);
kfree(nop->phy.otg);
kfree(nop);

return 0;
}
Expand Down

0 comments on commit 1cc2671

Please sign in to comment.