Skip to contentSkip to conversation

phy: fsl-imx8mq-usb: Constify imx8mp_usb_phy_ops

PATCH Applied Rikard Falkeborn 2 participants 2 messages Sep 26, 2020 – Oct 28, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: fsl-imx8mq-usb: Constify imx8mp_usb_phy_ops

The only usage of imx8mp_usb_phy_ops is to assign its address to the data field in the of_device_id struct, which is a const void pointer. Make it const to allow the compiler to put it in read-only memory.

---
 drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/freescale/phy-fsl-imx8mq-usb.c +1 -1
index 62d6d6849ad6..47a0c09bc9fa 100644
@@ -131,7 +131,7 @@ static const struct phy_ops imx8mq_usb_phy_ops = {
 	.owner		= THIS_MODULE,
 };
 
-static struct phy_ops imx8mp_usb_phy_ops = {
+static const struct phy_ops imx8mp_usb_phy_ops = {
 	.init		= imx8mp_usb_phy_init,
 	.power_on	= imx8mq_phy_power_on,
 	.power_off	= imx8mq_phy_power_off,
Signature · 1 line
2.28.0
maintainer Applied
#1 lore raw
Quoted 3 lines · Rikard Falkeborn

The only usage of imx8mp_usb_phy_ops is to assign its address to the data field in the of_device_id struct, which is a const void pointer. Make it const to allow the compiler to put it in read-only memory.

Applied, thanks

Signature · 6 lines
~Vinod

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel