usb: gadget: use platform_{get,set}_drvdata()

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>
This commit is contained in:
Jingoo Han 2013-05-23 19:19:22 +09:00 committed by Felipe Balbi
parent 6d3d61f821
commit dae8eadf2a
5 changed files with 9 additions and 9 deletions

View file

@ -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");
@ -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);

View file

@ -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);
@ -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;

View file

@ -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);
@ -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;

View file

@ -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);

View file

@ -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);
@ -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;