Skip to content

Commit

Permalink
usb: gadget: use platform_{get,set}_drvdata()
Browse files Browse the repository at this point in the history
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Jingoo Han authored and Felipe Balbi committed May 28, 2013
1 parent 6d3d61f commit dae8ead
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/fsl_qe_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ static int qe_udc_probe(struct platform_device *ofdev)
if (ret)
goto err6;

dev_set_drvdata(&ofdev->dev, udc);
platform_set_drvdata(ofdev, udc);
dev_info(udc->dev,
"%s USB controller initialized as device\n",
(udc->soc_type == PORT_QE) ? "QE" : "CPM");
Expand Down Expand Up @@ -2640,7 +2640,7 @@ static int qe_udc_resume(struct platform_device *dev)

static int qe_udc_remove(struct platform_device *ofdev)
{
struct qe_udc *udc = dev_get_drvdata(&ofdev->dev);
struct qe_udc *udc = platform_get_drvdata(ofdev);
struct qe_ep *ep;
unsigned int size;
DECLARE_COMPLETION(done);
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/fusb300_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ static const struct usb_gadget_ops fusb300_gadget_ops = {

static int __exit fusb300_remove(struct platform_device *pdev)
{
struct fusb300 *fusb300 = dev_get_drvdata(&pdev->dev);
struct fusb300 *fusb300 = platform_get_drvdata(pdev);

usb_del_gadget_udc(&fusb300->gadget);
iounmap(fusb300->reg);
Expand Down Expand Up @@ -1416,7 +1416,7 @@ static int __init fusb300_probe(struct platform_device *pdev)

spin_lock_init(&fusb300->lock);

dev_set_drvdata(&pdev->dev, fusb300);
platform_set_drvdata(pdev, fusb300);

fusb300->gadget.ops = &fusb300_gadget_ops;

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/m66592-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ static const struct usb_gadget_ops m66592_gadget_ops = {

static int __exit m66592_remove(struct platform_device *pdev)
{
struct m66592 *m66592 = dev_get_drvdata(&pdev->dev);
struct m66592 *m66592 = platform_get_drvdata(pdev);

usb_del_gadget_udc(&m66592->gadget);

Expand Down Expand Up @@ -1602,7 +1602,7 @@ static int __init m66592_probe(struct platform_device *pdev)
m66592->irq_trigger = ires->flags & IRQF_TRIGGER_MASK;

spin_lock_init(&m66592->lock);
dev_set_drvdata(&pdev->dev, m66592);
platform_set_drvdata(pdev, m66592);

m66592->gadget.ops = &m66592_gadget_ops;
m66592->gadget.max_speed = USB_SPEED_HIGH;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/mv_u3d_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,7 @@ static SIMPLE_DEV_PM_OPS(mv_u3d_pm_ops, mv_u3d_suspend, mv_u3d_resume);

static void mv_u3d_shutdown(struct platform_device *dev)
{
struct mv_u3d *u3d = dev_get_drvdata(&dev->dev);
struct mv_u3d *u3d = platform_get_drvdata(dev);
u32 tmp;

tmp = ioread32(&u3d->op_regs->usbcmd);
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/gadget/r8a66597-udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ static const struct usb_gadget_ops r8a66597_gadget_ops = {

static int __exit r8a66597_remove(struct platform_device *pdev)
{
struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev);
struct r8a66597 *r8a66597 = platform_get_drvdata(pdev);

usb_del_gadget_udc(&r8a66597->gadget);
del_timer_sync(&r8a66597->timer);
Expand Down Expand Up @@ -1909,7 +1909,7 @@ static int __init r8a66597_probe(struct platform_device *pdev)
}

spin_lock_init(&r8a66597->lock);
dev_set_drvdata(&pdev->dev, r8a66597);
platform_set_drvdata(pdev, r8a66597);
r8a66597->pdata = pdev->dev.platform_data;
r8a66597->irq_sense_low = irq_trigger == IRQF_TRIGGER_LOW;

Expand Down

0 comments on commit dae8ead

Please sign in to comment.