phy: Constify struct phy_ops variables
authorAxel Lin <axel.lin@ingics.com>
Wed, 15 Jul 2015 07:33:51 +0000 (15:33 +0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Mon, 3 Aug 2015 13:05:09 +0000 (18:35 +0530)
The phy_ops variables are never modified after initialized in these
drivers, so make them const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
31 files changed:
drivers/phy/phy-armada375-usb2.c
drivers/phy/phy-bcm-kona-usb2.c
drivers/phy/phy-berlin-sata.c
drivers/phy/phy-berlin-usb.c
drivers/phy/phy-brcmstb-sata.c
drivers/phy/phy-dm816x-usb.c
drivers/phy/phy-exynos-dp-video.c
drivers/phy/phy-exynos-mipi-video.c
drivers/phy/phy-exynos5-usbdrd.c
drivers/phy/phy-exynos5250-sata.c
drivers/phy/phy-hix5hd2-sata.c
drivers/phy/phy-miphy28lp.c
drivers/phy/phy-miphy365x.c
drivers/phy/phy-mvebu-sata.c
drivers/phy/phy-omap-usb2.c
drivers/phy/phy-qcom-apq8064-sata.c
drivers/phy/phy-qcom-ipq806x-sata.c
drivers/phy/phy-qcom-ufs-i.h
drivers/phy/phy-qcom-ufs-qmp-14nm.c
drivers/phy/phy-qcom-ufs-qmp-20nm.c
drivers/phy/phy-qcom-ufs.c
drivers/phy/phy-rcar-gen2.c
drivers/phy/phy-rockchip-usb.c
drivers/phy/phy-samsung-usb2.c
drivers/phy/phy-spear1310-miphy.c
drivers/phy/phy-spear1340-miphy.c
drivers/phy/phy-stih41x-usb.c
drivers/phy/phy-sun4i-usb.c
drivers/phy/phy-sun9i-usb.c
drivers/phy/phy-ti-pipe3.c
drivers/phy/phy-tusb1210.c

index 39c7d21f12da6b1bbc0771a377d1a683361128ce..1a3db288c0a9ac81ade8eadab50429931c1898af 100644 (file)
@@ -51,7 +51,7 @@ static int armada375_usb_phy_init(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops armada375_usb_phy_ops = {
+static const struct phy_ops armada375_usb_phy_ops = {
        .init = armada375_usb_phy_init,
        .owner = THIS_MODULE,
 };
index ef2dc1aab2b9b5ed03cf0511da89c6da1f78393d..7b67fe49e30bf7187cfc8ee24cad70a0dafedfd1 100644 (file)
@@ -91,7 +91,7 @@ static int bcm_kona_usb_phy_power_off(struct phy *gphy)
        return 0;
 }
 
-static struct phy_ops ops = {
+static const struct phy_ops ops = {
        .init           = bcm_kona_usb_phy_init,
        .power_on       = bcm_kona_usb_phy_power_on,
        .power_off      = bcm_kona_usb_phy_power_off,
index 6f3e06d687de99260b0300e10d0864387d740177..0062027afb1ef90335ae46782dba06448949b989 100644 (file)
@@ -176,7 +176,7 @@ static struct phy *phy_berlin_sata_phy_xlate(struct device *dev,
        return priv->phys[i]->phy;
 }
 
-static struct phy_ops phy_berlin_sata_ops = {
+static const struct phy_ops phy_berlin_sata_ops = {
        .power_on       = phy_berlin_sata_power_on,
        .power_off      = phy_berlin_sata_power_off,
        .owner          = THIS_MODULE,
index 0fe0d81c29ee4c1cf8d1b4609a125dd00b1922e9..204ee5952fb39df6a78b56521588a8e11aa0fd8d 100644 (file)
@@ -147,7 +147,7 @@ static int phy_berlin_usb_power_on(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops phy_berlin_usb_ops = {
+static const struct phy_ops phy_berlin_usb_ops = {
        .power_on       = phy_berlin_usb_power_on,
        .owner          = THIS_MODULE,
 };
index b7e303d28caff3d5eeb4cceade89c6a66047fdfa..8a2cb16a1937d20e88b045868beec28db966be5c 100644 (file)
@@ -122,7 +122,7 @@ static int brcm_sata_phy_init(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops phy_ops_28nm = {
+static const struct phy_ops phy_ops_28nm = {
        .init           = brcm_sata_phy_init,
        .owner          = THIS_MODULE,
 };
index 7b42555ddd51aac0d44714ef2254278d3fe59215..b4bbef664d206b4a73cd665986bd12eb988de285 100644 (file)
@@ -113,7 +113,7 @@ static int dm816x_usb_phy_init(struct phy *x)
        return 0;
 }
 
-static struct phy_ops ops = {
+static const struct phy_ops ops = {
        .init           = dm816x_usb_phy_init,
        .owner          = THIS_MODULE,
 };
index 179cbf9451aacf1aca440e46eb05493f41037e48..34b06154e5d959b8b2b0f429e62dd9ae0355151f 100644 (file)
@@ -48,7 +48,7 @@ static int exynos_dp_video_phy_power_off(struct phy *phy)
                                  EXYNOS5_PHY_ENABLE, 0);
 }
 
-static struct phy_ops exynos_dp_video_phy_ops = {
+static const struct phy_ops exynos_dp_video_phy_ops = {
        .power_on       = exynos_dp_video_phy_power_on,
        .power_off      = exynos_dp_video_phy_power_off,
        .owner          = THIS_MODULE,
index df7519a39ba0b15fd9181a3c3c9bcba17fcd34e9..2a54caba93b4021a5b48c44100ec42e9baf45da4 100644 (file)
@@ -124,7 +124,7 @@ static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
        return state->phys[args->args[0]].phy;
 }
 
-static struct phy_ops exynos_mipi_video_phy_ops = {
+static const struct phy_ops exynos_mipi_video_phy_ops = {
        .power_on       = exynos_mipi_video_phy_power_on,
        .power_off      = exynos_mipi_video_phy_power_off,
        .owner          = THIS_MODULE,
index d72ef15b0d68d575917fc6293e8e9bf6fc0e5342..20696f53303f0798059f45273cf817cb936ea415 100644 (file)
@@ -537,7 +537,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device *dev,
        return phy_drd->phys[args->args[0]].phy;
 }
 
-static struct phy_ops exynos5_usbdrd_phy_ops = {
+static const struct phy_ops exynos5_usbdrd_phy_ops = {
        .init           = exynos5_usbdrd_phy_init,
        .exit           = exynos5_usbdrd_phy_exit,
        .power_on       = exynos5_usbdrd_phy_power_on,
index bc858cc800a12bbbedad8bf18586cd9d9ee1ef78..60e13afcd9b849c568c15c543a3564fa9b5b1571 100644 (file)
@@ -154,7 +154,7 @@ static int exynos_sata_phy_init(struct phy *phy)
        return ret;
 }
 
-static struct phy_ops exynos_sata_phy_ops = {
+static const struct phy_ops exynos_sata_phy_ops = {
        .init           = exynos_sata_phy_init,
        .power_on       = exynos_sata_phy_power_on,
        .power_off      = exynos_sata_phy_power_off,
index d6b22659cac11cfb4187cf9347ac86774f79de5e..e5ab3aa78b9d2420a3564f802630c33b1036ce53 100644 (file)
@@ -129,7 +129,7 @@ static int hix5hd2_sata_phy_init(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops hix5hd2_sata_phy_ops = {
+static const struct phy_ops hix5hd2_sata_phy_ops = {
        .init           = hix5hd2_sata_phy_init,
        .owner          = THIS_MODULE,
 };
index 677c290f4b1405e59dbf9ceabfe6db32d7708f00..c47b56b4a2b8892810f00179a53e9eceba7c612c 100644 (file)
@@ -1132,7 +1132,7 @@ static struct phy *miphy28lp_xlate(struct device *dev,
        return miphy_phy->phy;
 }
 
-static struct phy_ops miphy28lp_ops = {
+static const struct phy_ops miphy28lp_ops = {
        .init = miphy28lp_init,
        .owner = THIS_MODULE,
 };
index 0ff354d6e1831b3f9a970ae8d6f30a4c0fa466da..00a686a073ed6ee804ea96ebcdb0ef3813482a85 100644 (file)
@@ -510,7 +510,7 @@ static struct phy *miphy365x_xlate(struct device *dev,
        return miphy_phy->phy;
 }
 
-static struct phy_ops miphy365x_ops = {
+static const struct phy_ops miphy365x_ops = {
        .init           = miphy365x_init,
        .owner          = THIS_MODULE,
 };
index 03b94f92e6f17b319c68a58f03ac8cf91ef0be75..768ce92e81ce7634f767612a99f37025185422db 100644 (file)
@@ -75,7 +75,7 @@ static int phy_mvebu_sata_power_off(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops phy_mvebu_sata_ops = {
+static const struct phy_ops phy_mvebu_sata_ops = {
        .power_on       = phy_mvebu_sata_power_on,
        .power_off      = phy_mvebu_sata_power_off,
        .owner          = THIS_MODULE,
index c1a468686bdc72433b7596512cb70852f3ef2420..0fe80589ffbea0cef4c00e85d242934c1dcb3f69 100644 (file)
@@ -137,7 +137,7 @@ static int omap_usb_init(struct phy *x)
        return 0;
 }
 
-static struct phy_ops ops = {
+static const struct phy_ops ops = {
        .init           = omap_usb_init,
        .power_on       = omap_usb_power_on,
        .power_off      = omap_usb_power_off,
index 4b243f7a10e4a9bb3e9e237e1a25dcb5f80b7b52..69ce2afac0150fb580630921ed4f9892d58dab77 100644 (file)
@@ -204,7 +204,7 @@ static int qcom_apq8064_sata_phy_exit(struct phy *generic_phy)
        return 0;
 }
 
-static struct phy_ops qcom_apq8064_sata_phy_ops = {
+static const struct phy_ops qcom_apq8064_sata_phy_ops = {
        .init           = qcom_apq8064_sata_phy_init,
        .exit           = qcom_apq8064_sata_phy_exit,
        .owner          = THIS_MODULE,
index 6f2fe26279165ff1b8e26821cfd243d0ab79a214..0ad127cc9298b10cb99988b7f40c7aa264bc1f47 100644 (file)
@@ -126,7 +126,7 @@ static int qcom_ipq806x_sata_phy_exit(struct phy *generic_phy)
        return 0;
 }
 
-static struct phy_ops qcom_ipq806x_sata_phy_ops = {
+static const struct phy_ops qcom_ipq806x_sata_phy_ops = {
        .init           = qcom_ipq806x_sata_phy_init,
        .exit           = qcom_ipq806x_sata_phy_exit,
        .owner          = THIS_MODULE,
index 591a39175e8a2357cd0f138cda151850a91963ea..2bd5ce43a7240d66429ed781b4780c33210897a0 100644 (file)
@@ -150,7 +150,7 @@ int ufs_qcom_phy_remove(struct phy *generic_phy,
                       struct ufs_qcom_phy *ufs_qcom_phy);
 struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
                        struct ufs_qcom_phy *common_cfg,
-                       struct phy_ops *ufs_qcom_phy_gen_ops,
+                       const struct phy_ops *ufs_qcom_phy_gen_ops,
                        struct ufs_qcom_phy_specific_ops *phy_spec_ops);
 int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,
                        struct ufs_qcom_phy_calibration *tbl_A, int tbl_size_A,
index e1eea1b379fcc0107fec6d701f5cb5467c5507c0..56631e77c11d7fb2ebd5e978869797d910b5daaf 100644 (file)
@@ -115,7 +115,7 @@ static int ufs_qcom_phy_qmp_14nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
        return err;
 }
 
-static struct phy_ops ufs_qcom_phy_qmp_14nm_phy_ops = {
+static const struct phy_ops ufs_qcom_phy_qmp_14nm_phy_ops = {
        .init           = ufs_qcom_phy_qmp_14nm_init,
        .exit           = ufs_qcom_phy_exit,
        .power_on       = ufs_qcom_phy_power_on,
index fde8c876823b8bc30e580b3764f74e06da2ac820..b16ea77d07b923c1a29f57def315bcdc032a9d40 100644 (file)
@@ -171,7 +171,7 @@ static int ufs_qcom_phy_qmp_20nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
        return err;
 }
 
-static struct phy_ops ufs_qcom_phy_qmp_20nm_phy_ops = {
+static const struct phy_ops ufs_qcom_phy_qmp_20nm_phy_ops = {
        .init           = ufs_qcom_phy_qmp_20nm_init,
        .exit           = ufs_qcom_phy_exit,
        .power_on       = ufs_qcom_phy_power_on,
index f9c618f0ab6e4fe120462616b2c84ba0d9fe30a6..49a1ed0cef56fe7cbf9aed102b47149415f021f0 100644 (file)
@@ -77,7 +77,7 @@ EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate);
 
 struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
                                struct ufs_qcom_phy *common_cfg,
-                               struct phy_ops *ufs_qcom_phy_gen_ops,
+                               const struct phy_ops *ufs_qcom_phy_gen_ops,
                                struct ufs_qcom_phy_specific_ops *phy_spec_ops)
 {
        int err;
index 39d9b299543572f01a3712b85e18c07a1bef605d..6e0d9fa8e1d13f8d1ad0eec73b1040f594637df7 100644 (file)
@@ -184,7 +184,7 @@ static int rcar_gen2_phy_power_off(struct phy *p)
        return 0;
 }
 
-static struct phy_ops rcar_gen2_phy_ops = {
+static const struct phy_ops rcar_gen2_phy_ops = {
        .init           = rcar_gen2_phy_init,
        .exit           = rcar_gen2_phy_exit,
        .power_on       = rcar_gen2_phy_power_on,
index bf78721b58f449f1d3410de7b34d10b2a3da27ec..5a5c073e72fe1ee6115bea310890b646b6b40a69 100644 (file)
@@ -84,7 +84,7 @@ static int rockchip_usb_phy_power_on(struct phy *_phy)
        return 0;
 }
 
-static struct phy_ops ops = {
+static const struct phy_ops ops = {
        .power_on       = rockchip_usb_phy_power_on,
        .power_off      = rockchip_usb_phy_power_off,
        .owner          = THIS_MODULE,
index 55b6994932e37f0b3d5d14c72cb1ff7df4807f85..f278a9c547e199c6228081f3445133dcdd9cda46 100644 (file)
@@ -71,7 +71,7 @@ static int samsung_usb2_phy_power_off(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops samsung_usb2_phy_ops = {
+static const struct phy_ops samsung_usb2_phy_ops = {
        .power_on       = samsung_usb2_phy_power_on,
        .power_off      = samsung_usb2_phy_power_off,
        .owner          = THIS_MODULE,
index 45d0005b2203f14777fff62f8ba30cffe4d779fc..ed67e98e54ca6560e567d4b3944d674651538681 100644 (file)
@@ -179,7 +179,7 @@ static const struct of_device_id spear1310_miphy_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, spear1310_miphy_of_match);
 
-static struct phy_ops spear1310_miphy_ops = {
+static const struct phy_ops spear1310_miphy_ops = {
        .init = spear1310_miphy_init,
        .exit = spear1310_miphy_exit,
        .owner = THIS_MODULE,
index 494240da4a398e4554f60a3c960df6234dbb8d84..97280c0cf6128c2a0339a27e7f207702ffe6762e 100644 (file)
@@ -189,7 +189,7 @@ static const struct of_device_id spear1340_miphy_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, spear1340_miphy_of_match);
 
-static struct phy_ops spear1340_miphy_ops = {
+static const struct phy_ops spear1340_miphy_ops = {
        .init = spear1340_miphy_init,
        .exit = spear1340_miphy_exit,
        .owner = THIS_MODULE,
index c093b472b57dadee94b832a989f5495a07dc98f2..0ac74639ad0244aa81e9f4878c58c5d6aff39841 100644 (file)
@@ -112,7 +112,7 @@ static int stih41x_usb_phy_power_off(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops stih41x_usb_phy_ops = {
+static const struct phy_ops stih41x_usb_phy_ops = {
        .init           = stih41x_usb_phy_init,
        .power_on       = stih41x_usb_phy_power_on,
        .power_off      = stih41x_usb_phy_power_off,
index e2eb688d82f5addeebaee52eb07e93e38a35034f..623c7143152e432f15fac0a5e7d209b0b28adc15 100644 (file)
@@ -373,7 +373,7 @@ void sun4i_usb_phy_set_squelch_detect(struct phy *_phy, bool enabled)
        sun4i_usb_phy_write(phy, PHY_SQUELCH_DETECT, enabled ? 0 : 2, 2);
 }
 
-static struct phy_ops sun4i_usb_phy_ops = {
+static const struct phy_ops sun4i_usb_phy_ops = {
        .init           = sun4i_usb_phy_init,
        .exit           = sun4i_usb_phy_exit,
        .power_on       = sun4i_usb_phy_power_on,
index 0095914a662c05916db38d1693ab1fa189a45a04..ac4f31abefe33e45a4b1cdf5636c7c1ba05f716d 100644 (file)
@@ -114,7 +114,7 @@ static int sun9i_usb_phy_exit(struct phy *_phy)
        return 0;
 }
 
-static struct phy_ops sun9i_usb_phy_ops = {
+static const struct phy_ops sun9i_usb_phy_ops = {
        .init           = sun9i_usb_phy_init,
        .exit           = sun9i_usb_phy_exit,
        .owner          = THIS_MODULE,
index 53f295c1bab1a72108d84b955714b8aef4d7e951..2038f1945f2c133cae52dad762f2f34b4412a821 100644 (file)
@@ -279,7 +279,7 @@ static int ti_pipe3_exit(struct phy *x)
 
        return 0;
 }
-static struct phy_ops ops = {
+static const struct phy_ops ops = {
        .init           = ti_pipe3_init,
        .exit           = ti_pipe3_exit,
        .power_on       = ti_pipe3_power_on,
index 07efdd318bdc9215d4de464aa3a19f7cc22ec612..2535d792d57af69277460ed4bc51beb39065d1d5 100644 (file)
@@ -53,7 +53,7 @@ static int tusb1210_power_off(struct phy *phy)
        return 0;
 }
 
-static struct phy_ops phy_ops = {
+static const struct phy_ops phy_ops = {
        .power_on = tusb1210_power_on,
        .power_off = tusb1210_power_off,
        .owner = THIS_MODULE,