Skip to content

Commit

Permalink
usb: cdns3: Refactoring names in reusable code
Browse files Browse the repository at this point in the history
Patch change the functions and objects names in reusable code.
The reusable code includes core.c, core.h, drd.c and drd.h files.
It also changes the names of all references to these functions and
objects in other cdns3 files. There are a lot of changes, but all
changes are very trivial.
The reason of this patch is to avoid of mixing prefix cdns3 and cdnsp in
in cdnsp driver what could introduce some confusion in understanding
of cdnsp driver.
This patch assumes to use three different prefixes in Cadence
USB drivers:
  cdns: for common reusable code
  cdnsp: for names related only with cdnsp driver
  cdns3: for names related only with cdns3 driver

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
Tested-by: Aswath Govindraju <a-govindraju@ti.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
  • Loading branch information
Pawel Laszczak authored and Peter Chen committed Dec 29, 2020
1 parent 394c3a1 commit 0b49004
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 198 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/cdns3/cdns3-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static void cdns3_set_wakeup(struct cdns_imx *data, bool enable)
static int cdns_imx_platform_suspend(struct device *dev,
bool suspend, bool wakeup)
{
struct cdns3 *cdns = dev_get_drvdata(dev);
struct cdns *cdns = dev_get_drvdata(dev);
struct device *parent = dev->parent;
struct cdns_imx *data = dev_get_drvdata(parent);
void __iomem *otg_regs = (void __iomem *)(cdns->otg_regs);
Expand Down
25 changes: 13 additions & 12 deletions drivers/usb/cdns3/cdns3-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "core.h"
#include "gadget-export.h"

static int set_phy_power_on(struct cdns3 *cdns)
static int set_phy_power_on(struct cdns *cdns)
{
int ret;

Expand All @@ -35,7 +35,7 @@ static int set_phy_power_on(struct cdns3 *cdns)
return ret;
}

static void set_phy_power_off(struct cdns3 *cdns)
static void set_phy_power_off(struct cdns *cdns)
{
phy_power_off(cdns->usb3_phy);
phy_power_off(cdns->usb2_phy);
Expand All @@ -51,7 +51,7 @@ static int cdns3_plat_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct resource *res;
struct cdns3 *cdns;
struct cdns *cdns;
void __iomem *regs;
int ret;

Expand Down Expand Up @@ -136,7 +136,8 @@ static int cdns3_plat_probe(struct platform_device *pdev)
goto err_phy_power_on;

cdns->gadget_init = cdns3_gadget_init;
ret = cdns3_init(cdns);

ret = cdns_init(cdns);
if (ret)
goto err_cdns_init;

Expand Down Expand Up @@ -175,13 +176,13 @@ static int cdns3_plat_probe(struct platform_device *pdev)
*/
static int cdns3_plat_remove(struct platform_device *pdev)
{
struct cdns3 *cdns = platform_get_drvdata(pdev);
struct cdns *cdns = platform_get_drvdata(pdev);
struct device *dev = cdns->dev;

pm_runtime_get_sync(dev);
pm_runtime_disable(dev);
pm_runtime_put_noidle(dev);
cdns3_remove(cdns);
cdns_remove(cdns);
set_phy_power_off(cdns);
phy_exit(cdns->usb2_phy);
phy_exit(cdns->usb3_phy);
Expand All @@ -193,7 +194,7 @@ static int cdns3_plat_remove(struct platform_device *pdev)
static int cdns3_set_platform_suspend(struct device *dev,
bool suspend, bool wakeup)
{
struct cdns3 *cdns = dev_get_drvdata(dev);
struct cdns *cdns = dev_get_drvdata(dev);
int ret = 0;

if (cdns->pdata && cdns->pdata->platform_suspend)
Expand All @@ -204,7 +205,7 @@ static int cdns3_set_platform_suspend(struct device *dev,

static int cdns3_controller_suspend(struct device *dev, pm_message_t msg)
{
struct cdns3 *cdns = dev_get_drvdata(dev);
struct cdns *cdns = dev_get_drvdata(dev);
bool wakeup;
unsigned long flags;

Expand All @@ -228,7 +229,7 @@ static int cdns3_controller_suspend(struct device *dev, pm_message_t msg)

static int cdns3_controller_resume(struct device *dev, pm_message_t msg)
{
struct cdns3 *cdns = dev_get_drvdata(dev);
struct cdns *cdns = dev_get_drvdata(dev);
int ret;
unsigned long flags;

Expand All @@ -242,7 +243,7 @@ static int cdns3_controller_resume(struct device *dev, pm_message_t msg)
cdns3_set_platform_suspend(cdns->dev, false, false);

spin_lock_irqsave(&cdns->lock, flags);
cdns3_resume(cdns, !PMSG_IS_AUTO(msg));
cdns_resume(cdns, !PMSG_IS_AUTO(msg));
cdns->in_lpm = false;
spin_unlock_irqrestore(&cdns->lock, flags);
if (cdns->wakeup_pending) {
Expand All @@ -268,9 +269,9 @@ static int cdns3_plat_runtime_resume(struct device *dev)

static int cdns3_plat_suspend(struct device *dev)
{
struct cdns3 *cdns = dev_get_drvdata(dev);
struct cdns *cdns = dev_get_drvdata(dev);

cdns3_suspend(cdns);
cdns_suspend(cdns);

return cdns3_controller_suspend(dev, PMSG_SUSPEND);
}
Expand Down
Loading

0 comments on commit 0b49004

Please sign in to comment.