Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8df2768 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by Kishon Vijay Abraham I
Browse files

drivers: phy: constify phy_ops structures



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: default avatarBhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 66adb889
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,