usb: musb: dsps: Use dev_get_drvdata()
authorKefeng Wang <wangkefeng.wang@huawei.com>
Tue, 30 Apr 2019 14:59:41 +0000 (09:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Apr 2019 15:55:08 +0000 (17:55 +0200)
Using dev_get_drvdata directly.

Cc: Bin Liu <b-liu@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_dsps.c

index 403eb97915f8a86f15dc00f07c2077890663dc25..327d4f7baaf7c17bace48f0ed4908e83b200fd56 100644 (file)
@@ -168,8 +168,7 @@ static void dsps_mod_timer_optional(struct dsps_glue *glue)
 static void dsps_musb_enable(struct musb *musb)
 {
        struct device *dev = musb->controller;
-       struct platform_device *pdev = to_platform_device(dev->parent);
-       struct dsps_glue *glue = platform_get_drvdata(pdev);
+       struct dsps_glue *glue = dev_get_drvdata(dev->parent);
        const struct dsps_musb_wrapper *wrp = glue->wrp;
        void __iomem *reg_base = musb->ctrl_base;
        u32 epmask, coremask;
@@ -195,8 +194,7 @@ static void dsps_musb_enable(struct musb *musb)
 static void dsps_musb_disable(struct musb *musb)
 {
        struct device *dev = musb->controller;
-       struct platform_device *pdev = to_platform_device(dev->parent);
-       struct dsps_glue *glue = platform_get_drvdata(pdev);
+       struct dsps_glue *glue = dev_get_drvdata(dev->parent);
        const struct dsps_musb_wrapper *wrp = glue->wrp;
        void __iomem *reg_base = musb->ctrl_base;