From: Kishon Vijay Abraham I <kishon@ti.com>
To: <gregkh@linuxfoundation.org>
Cc: <kishon@ti.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH 04/14] drivers: phy: constify phy_ops structures
Date: Mon, 30 Jan 2017 17:19:30 +0530 [thread overview]
Message-ID: <1485776992-8818-8-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1485776992-8818-1-git-send-email-kishon@ti.com>
From: Bhumika Goyal <bhumirks@gmail.com>
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 | 2 +-
drivers/phy/phy-hi6220-usb.c | 2 +-
drivers/phy/phy-mt65xx-usb3.c | 2 +-
drivers/phy/phy-rcar-gen3-usb2.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/phy/phy-bcm-cygnus-pcie.c b/drivers/phy/phy-bcm-cygnus-pcie.c
index 082c03f..0f4ac5d 100644
--- a/drivers/phy/phy-bcm-cygnus-pcie.c
+++ b/drivers/phy/phy-bcm-cygnus-pcie.c
@@ -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,
diff --git a/drivers/phy/phy-hi6220-usb.c b/drivers/phy/phy-hi6220-usb.c
index b2141cb..398c102 100644
--- a/drivers/phy/phy-hi6220-usb.c
+++ b/drivers/phy/phy-hi6220-usb.c
@@ -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,
diff --git a/drivers/phy/phy-mt65xx-usb3.c b/drivers/phy/phy-mt65xx-usb3.c
index 4d85e73..d972067 100644
--- a/drivers/phy/phy-mt65xx-usb3.c
+++ b/drivers/phy/phy-mt65xx-usb3.c
@@ -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,
diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
index 54a8367..afb4d04 100644
--- a/drivers/phy/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/phy-rcar-gen3-usb2.c
@@ -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,
--
1.7.9.5
next prev parent reply other threads:[~2017-01-30 11:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 11:49 [GIT PULL] phy: for 4.11 Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 01/15] phy: rockchip-inno-usb2: Set EXTCON_USB when EXTCON_CHG_USB_SDP was set Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 01/14] phy: sun4i-usb: add support for V3s USB PHY Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 02/14] phy: rcar-gen3-usb2: Replace the deprecated extcon API Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 02/15] phy: sun4i-usb: add support for V3s USB PHY Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 03/15] phy: rcar-gen3-usb2: Replace the deprecated extcon API Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 03/14] phy: sun4i-usb: " Kishon Vijay Abraham I
2017-01-30 11:49 ` Kishon Vijay Abraham I [this message]
2017-01-30 11:49 ` [PATCH 04/15] " Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 05/15] drivers: phy: constify phy_ops structures Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 05/14] phy: Add support for Qualcomm's USB HSIC phy Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 06/14] phy: Add support for Qualcomm's USB HS phy Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 06/15] phy: Add support for Qualcomm's USB HSIC phy Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 07/15] phy: Add support for Qualcomm's USB HS phy Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 07/14] phy: qcom-ufs: Don't kfree devres resource Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 08/15] " Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 09/15] phy: qcom-ufs: Correct usage of regulator_get() Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 09/14] phy: qcom-ufs: Remove -always-on property Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 10/15] " Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 10/14] phy: qcom-ufs: Suppress extraneous logging Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 11/14] dt-bindings: phy: Add documentation for NSP USB3 PHY Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 11/15] phy: qcom-ufs: Suppress extraneous logging Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 12/15] dt-bindings: phy: Add documentation for NSP USB3 PHY Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 12/14] phy: Add USB3 PHY support for Broadcom NSP SoC Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 13/15] " Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 13/14] phy: fix rockchip-inno-usb2 build errors Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 14/15] " Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 14/14] phy: qcom-ufs: Fix misplaced jump label Kishon Vijay Abraham I
2017-01-30 11:49 ` [PATCH 15/15] " Kishon Vijay Abraham I
2017-01-31 9:53 ` [GIT PULL] phy: for 4.11 Greg KH
2017-01-31 10:03 ` Kishon Vijay Abraham I
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485776992-8818-8-git-send-email-kishon@ti.com \
--to=kishon@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome