Commit 4a9e5ca1 authored by Axel Lin's avatar Axel Lin Committed by Kishon Vijay Abraham I

phy: Constify struct phy_ops variables

The phy_ops variables are never modified after initialized in these
drivers, so make them const.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarPatrice Chotard <patrice.chotard@st.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 42ad8f67
...@@ -51,7 +51,7 @@ static int armada375_usb_phy_init(struct phy *phy) ...@@ -51,7 +51,7 @@ static int armada375_usb_phy_init(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops armada375_usb_phy_ops = { static const struct phy_ops armada375_usb_phy_ops = {
.init = armada375_usb_phy_init, .init = armada375_usb_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -91,7 +91,7 @@ static int bcm_kona_usb_phy_power_off(struct phy *gphy) ...@@ -91,7 +91,7 @@ static int bcm_kona_usb_phy_power_off(struct phy *gphy)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = bcm_kona_usb_phy_init, .init = bcm_kona_usb_phy_init,
.power_on = bcm_kona_usb_phy_power_on, .power_on = bcm_kona_usb_phy_power_on,
.power_off = bcm_kona_usb_phy_power_off, .power_off = bcm_kona_usb_phy_power_off,
......
...@@ -176,7 +176,7 @@ static struct phy *phy_berlin_sata_phy_xlate(struct device *dev, ...@@ -176,7 +176,7 @@ static struct phy *phy_berlin_sata_phy_xlate(struct device *dev,
return priv->phys[i]->phy; 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_on = phy_berlin_sata_power_on,
.power_off = phy_berlin_sata_power_off, .power_off = phy_berlin_sata_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -147,7 +147,7 @@ static int phy_berlin_usb_power_on(struct phy *phy) ...@@ -147,7 +147,7 @@ static int phy_berlin_usb_power_on(struct phy *phy)
return 0; 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, .power_on = phy_berlin_usb_power_on,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -122,7 +122,7 @@ static int brcm_sata_phy_init(struct phy *phy) ...@@ -122,7 +122,7 @@ static int brcm_sata_phy_init(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops phy_ops_28nm = { static const struct phy_ops phy_ops_28nm = {
.init = brcm_sata_phy_init, .init = brcm_sata_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -113,7 +113,7 @@ static int dm816x_usb_phy_init(struct phy *x) ...@@ -113,7 +113,7 @@ static int dm816x_usb_phy_init(struct phy *x)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = dm816x_usb_phy_init, .init = dm816x_usb_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -48,7 +48,7 @@ static int exynos_dp_video_phy_power_off(struct phy *phy) ...@@ -48,7 +48,7 @@ static int exynos_dp_video_phy_power_off(struct phy *phy)
EXYNOS5_PHY_ENABLE, 0); 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_on = exynos_dp_video_phy_power_on,
.power_off = exynos_dp_video_phy_power_off, .power_off = exynos_dp_video_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -124,7 +124,7 @@ static struct phy *exynos_mipi_video_phy_xlate(struct device *dev, ...@@ -124,7 +124,7 @@ static struct phy *exynos_mipi_video_phy_xlate(struct device *dev,
return state->phys[args->args[0]].phy; 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_on = exynos_mipi_video_phy_power_on,
.power_off = exynos_mipi_video_phy_power_off, .power_off = exynos_mipi_video_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -537,7 +537,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device *dev, ...@@ -537,7 +537,7 @@ static struct phy *exynos5_usbdrd_phy_xlate(struct device *dev,
return phy_drd->phys[args->args[0]].phy; 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, .init = exynos5_usbdrd_phy_init,
.exit = exynos5_usbdrd_phy_exit, .exit = exynos5_usbdrd_phy_exit,
.power_on = exynos5_usbdrd_phy_power_on, .power_on = exynos5_usbdrd_phy_power_on,
......
...@@ -154,7 +154,7 @@ static int exynos_sata_phy_init(struct phy *phy) ...@@ -154,7 +154,7 @@ static int exynos_sata_phy_init(struct phy *phy)
return ret; return ret;
} }
static struct phy_ops exynos_sata_phy_ops = { static const struct phy_ops exynos_sata_phy_ops = {
.init = exynos_sata_phy_init, .init = exynos_sata_phy_init,
.power_on = exynos_sata_phy_power_on, .power_on = exynos_sata_phy_power_on,
.power_off = exynos_sata_phy_power_off, .power_off = exynos_sata_phy_power_off,
......
...@@ -129,7 +129,7 @@ static int hix5hd2_sata_phy_init(struct phy *phy) ...@@ -129,7 +129,7 @@ static int hix5hd2_sata_phy_init(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops hix5hd2_sata_phy_ops = { static const struct phy_ops hix5hd2_sata_phy_ops = {
.init = hix5hd2_sata_phy_init, .init = hix5hd2_sata_phy_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -1132,7 +1132,7 @@ static struct phy *miphy28lp_xlate(struct device *dev, ...@@ -1132,7 +1132,7 @@ static struct phy *miphy28lp_xlate(struct device *dev,
return miphy_phy->phy; return miphy_phy->phy;
} }
static struct phy_ops miphy28lp_ops = { static const struct phy_ops miphy28lp_ops = {
.init = miphy28lp_init, .init = miphy28lp_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -510,7 +510,7 @@ static struct phy *miphy365x_xlate(struct device *dev, ...@@ -510,7 +510,7 @@ static struct phy *miphy365x_xlate(struct device *dev,
return miphy_phy->phy; return miphy_phy->phy;
} }
static struct phy_ops miphy365x_ops = { static const struct phy_ops miphy365x_ops = {
.init = miphy365x_init, .init = miphy365x_init,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
......
...@@ -75,7 +75,7 @@ static int phy_mvebu_sata_power_off(struct phy *phy) ...@@ -75,7 +75,7 @@ static int phy_mvebu_sata_power_off(struct phy *phy)
return 0; 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_on = phy_mvebu_sata_power_on,
.power_off = phy_mvebu_sata_power_off, .power_off = phy_mvebu_sata_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -137,7 +137,7 @@ static int omap_usb_init(struct phy *x) ...@@ -137,7 +137,7 @@ static int omap_usb_init(struct phy *x)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = omap_usb_init, .init = omap_usb_init,
.power_on = omap_usb_power_on, .power_on = omap_usb_power_on,
.power_off = omap_usb_power_off, .power_off = omap_usb_power_off,
......
...@@ -204,7 +204,7 @@ static int qcom_apq8064_sata_phy_exit(struct phy *generic_phy) ...@@ -204,7 +204,7 @@ static int qcom_apq8064_sata_phy_exit(struct phy *generic_phy)
return 0; 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, .init = qcom_apq8064_sata_phy_init,
.exit = qcom_apq8064_sata_phy_exit, .exit = qcom_apq8064_sata_phy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -126,7 +126,7 @@ static int qcom_ipq806x_sata_phy_exit(struct phy *generic_phy) ...@@ -126,7 +126,7 @@ static int qcom_ipq806x_sata_phy_exit(struct phy *generic_phy)
return 0; 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, .init = qcom_ipq806x_sata_phy_init,
.exit = qcom_ipq806x_sata_phy_exit, .exit = qcom_ipq806x_sata_phy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -150,7 +150,7 @@ int ufs_qcom_phy_remove(struct phy *generic_phy, ...@@ -150,7 +150,7 @@ int ufs_qcom_phy_remove(struct phy *generic_phy,
struct ufs_qcom_phy *ufs_qcom_phy); struct ufs_qcom_phy *ufs_qcom_phy);
struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev, struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
struct ufs_qcom_phy *common_cfg, 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); struct ufs_qcom_phy_specific_ops *phy_spec_ops);
int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy, int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy,
struct ufs_qcom_phy_calibration *tbl_A, int tbl_size_A, struct ufs_qcom_phy_calibration *tbl_A, int tbl_size_A,
......
...@@ -115,7 +115,7 @@ static int ufs_qcom_phy_qmp_14nm_is_pcs_ready(struct ufs_qcom_phy *phy_common) ...@@ -115,7 +115,7 @@ static int ufs_qcom_phy_qmp_14nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
return err; 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, .init = ufs_qcom_phy_qmp_14nm_init,
.exit = ufs_qcom_phy_exit, .exit = ufs_qcom_phy_exit,
.power_on = ufs_qcom_phy_power_on, .power_on = ufs_qcom_phy_power_on,
......
...@@ -171,7 +171,7 @@ static int ufs_qcom_phy_qmp_20nm_is_pcs_ready(struct ufs_qcom_phy *phy_common) ...@@ -171,7 +171,7 @@ static int ufs_qcom_phy_qmp_20nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
return err; 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, .init = ufs_qcom_phy_qmp_20nm_init,
.exit = ufs_qcom_phy_exit, .exit = ufs_qcom_phy_exit,
.power_on = ufs_qcom_phy_power_on, .power_on = ufs_qcom_phy_power_on,
......
...@@ -77,7 +77,7 @@ EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate); ...@@ -77,7 +77,7 @@ EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate);
struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev, struct phy *ufs_qcom_phy_generic_probe(struct platform_device *pdev,
struct ufs_qcom_phy *common_cfg, 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) struct ufs_qcom_phy_specific_ops *phy_spec_ops)
{ {
int err; int err;
......
...@@ -184,7 +184,7 @@ static int rcar_gen2_phy_power_off(struct phy *p) ...@@ -184,7 +184,7 @@ static int rcar_gen2_phy_power_off(struct phy *p)
return 0; return 0;
} }
static struct phy_ops rcar_gen2_phy_ops = { static const struct phy_ops rcar_gen2_phy_ops = {
.init = rcar_gen2_phy_init, .init = rcar_gen2_phy_init,
.exit = rcar_gen2_phy_exit, .exit = rcar_gen2_phy_exit,
.power_on = rcar_gen2_phy_power_on, .power_on = rcar_gen2_phy_power_on,
......
...@@ -84,7 +84,7 @@ static int rockchip_usb_phy_power_on(struct phy *_phy) ...@@ -84,7 +84,7 @@ static int rockchip_usb_phy_power_on(struct phy *_phy)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.power_on = rockchip_usb_phy_power_on, .power_on = rockchip_usb_phy_power_on,
.power_off = rockchip_usb_phy_power_off, .power_off = rockchip_usb_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -71,7 +71,7 @@ static int samsung_usb2_phy_power_off(struct phy *phy) ...@@ -71,7 +71,7 @@ static int samsung_usb2_phy_power_off(struct phy *phy)
return 0; 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_on = samsung_usb2_phy_power_on,
.power_off = samsung_usb2_phy_power_off, .power_off = samsung_usb2_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -179,7 +179,7 @@ static const struct of_device_id spear1310_miphy_of_match[] = { ...@@ -179,7 +179,7 @@ static const struct of_device_id spear1310_miphy_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, 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, .init = spear1310_miphy_init,
.exit = spear1310_miphy_exit, .exit = spear1310_miphy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -189,7 +189,7 @@ static const struct of_device_id spear1340_miphy_of_match[] = { ...@@ -189,7 +189,7 @@ static const struct of_device_id spear1340_miphy_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, 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, .init = spear1340_miphy_init,
.exit = spear1340_miphy_exit, .exit = spear1340_miphy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -112,7 +112,7 @@ static int stih41x_usb_phy_power_off(struct phy *phy) ...@@ -112,7 +112,7 @@ static int stih41x_usb_phy_power_off(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops stih41x_usb_phy_ops = { static const struct phy_ops stih41x_usb_phy_ops = {
.init = stih41x_usb_phy_init, .init = stih41x_usb_phy_init,
.power_on = stih41x_usb_phy_power_on, .power_on = stih41x_usb_phy_power_on,
.power_off = stih41x_usb_phy_power_off, .power_off = stih41x_usb_phy_power_off,
......
...@@ -373,7 +373,7 @@ void sun4i_usb_phy_set_squelch_detect(struct phy *_phy, bool enabled) ...@@ -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); 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, .init = sun4i_usb_phy_init,
.exit = sun4i_usb_phy_exit, .exit = sun4i_usb_phy_exit,
.power_on = sun4i_usb_phy_power_on, .power_on = sun4i_usb_phy_power_on,
......
...@@ -114,7 +114,7 @@ static int sun9i_usb_phy_exit(struct phy *_phy) ...@@ -114,7 +114,7 @@ static int sun9i_usb_phy_exit(struct phy *_phy)
return 0; return 0;
} }
static struct phy_ops sun9i_usb_phy_ops = { static const struct phy_ops sun9i_usb_phy_ops = {
.init = sun9i_usb_phy_init, .init = sun9i_usb_phy_init,
.exit = sun9i_usb_phy_exit, .exit = sun9i_usb_phy_exit,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -279,7 +279,7 @@ static int ti_pipe3_exit(struct phy *x) ...@@ -279,7 +279,7 @@ static int ti_pipe3_exit(struct phy *x)
return 0; return 0;
} }
static struct phy_ops ops = { static const struct phy_ops ops = {
.init = ti_pipe3_init, .init = ti_pipe3_init,
.exit = ti_pipe3_exit, .exit = ti_pipe3_exit,
.power_on = ti_pipe3_power_on, .power_on = ti_pipe3_power_on,
......
...@@ -53,7 +53,7 @@ static int tusb1210_power_off(struct phy *phy) ...@@ -53,7 +53,7 @@ static int tusb1210_power_off(struct phy *phy)
return 0; return 0;
} }
static struct phy_ops phy_ops = { static const struct phy_ops phy_ops = {
.power_on = tusb1210_power_on, .power_on = tusb1210_power_on,
.power_off = tusb1210_power_off, .power_off = tusb1210_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment