drivers: phy: constify phy_ops structures
authorBhumika Goyal <bhumirks@gmail.com>
Sun, 8 Jan 2017 10:35:56 +0000 (16:05 +0530)
committerKishon Vijay Abraham I <kishon@ti.com>
Mon, 16 Jan 2017 11:11:51 +0000 (16:41 +0530)
Declare phy_ops structures as const as they are only passed as an
argument to the function devm_phy_create. This argument is of type const
struct phy_ops *, so phy_ops structures having this property can be
declared as const.
Done using Coccinelle:

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-bcm-cygnus-pcie.c
drivers/phy/phy-hi6220-usb.c
drivers/phy/phy-mt65xx-usb3.c
drivers/phy/phy-rcar-gen3-usb2.c

index 082c03f6438f796af868cb83127f1ce9ca56f83b..0f4ac5d63cff93211b8e0864b1de3e0e24fecfb5 100644 (file)
@@ -114,7 +114,7 @@ static int cygnus_pcie_phy_power_off(struct phy *p)
        return cygnus_pcie_power_config(phy, false);
 }
 
-static struct phy_ops cygnus_pcie_phy_ops = {
+static const struct phy_ops cygnus_pcie_phy_ops = {
        .power_on = cygnus_pcie_phy_power_on,
        .power_off = cygnus_pcie_phy_power_off,
        .owner = THIS_MODULE,
index b2141cbd4cf6cd7e5eb0127c58f1141b11fb5e53..398c1021deec056e2324fc1f22fc5efd19058682 100644 (file)
@@ -112,7 +112,7 @@ static int hi6220_phy_exit(struct phy *phy)
        return hi6220_phy_setup(priv, false);
 }
 
-static struct phy_ops hi6220_phy_ops = {
+static const struct phy_ops hi6220_phy_ops = {
        .init           = hi6220_phy_start,
        .exit           = hi6220_phy_exit,
        .owner          = THIS_MODULE,
index 4d85e730ccab131dc0821423c5d73427b6f89097..d9720675b9db311e0d847ee3c1bbac0ae3318811 100644 (file)
@@ -506,7 +506,7 @@ static struct phy *mt65xx_phy_xlate(struct device *dev,
        return instance->phy;
 }
 
-static struct phy_ops mt65xx_u3phy_ops = {
+static const struct phy_ops mt65xx_u3phy_ops = {
        .init           = mt65xx_phy_init,
        .exit           = mt65xx_phy_exit,
        .power_on       = mt65xx_phy_power_on,
index 54a83675f0a8cfacf9007241c32d9f86c1d04f45..afb4d048d3e984c5cc02e83b12a2b10d55bb561d 100644 (file)
@@ -350,7 +350,7 @@ static int rcar_gen3_phy_usb2_power_off(struct phy *p)
        return ret;
 }
 
-static struct phy_ops rcar_gen3_phy_usb2_ops = {
+static const struct phy_ops rcar_gen3_phy_usb2_ops = {
        .init           = rcar_gen3_phy_usb2_init,
        .exit           = rcar_gen3_phy_usb2_exit,
        .power_on       = rcar_gen3_phy_usb2_power_on,