OSDN Git Service

phy: qcom-ipq4019-usb: Constify static phy_ops structs
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sun, 23 Aug 2020 22:00:25 +0000 (00:00 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 31 Aug 2020 09:06:37 +0000 (14:36 +0530)
Their only usages is to assign the address to the data field in the
of_device_id struct, which is a const void pointer. Make them const to
allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20200823220025.17588-9-rikard.falkeborn@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c

index b8ef331..fc7f9df 100644 (file)
@@ -48,7 +48,7 @@ static int ipq4019_ss_phy_power_on(struct phy *_phy)
        return 0;
 }
 
-static struct phy_ops ipq4019_usb_ss_phy_ops = {
+static const struct phy_ops ipq4019_usb_ss_phy_ops = {
        .power_on       = ipq4019_ss_phy_power_on,
        .power_off      = ipq4019_ss_phy_power_off,
 };
@@ -80,7 +80,7 @@ static int ipq4019_hs_phy_power_on(struct phy *_phy)
        return 0;
 }
 
-static struct phy_ops ipq4019_usb_hs_phy_ops = {
+static const struct phy_ops ipq4019_usb_hs_phy_ops = {
        .power_on       = ipq4019_hs_phy_power_on,
        .power_off      = ipq4019_hs_phy_power_off,
 };