Skip to contentSkip to conversation

phy: ulpi_phy: Add const qualifier to ops

PATCH In review Axel Lin 2 participants 3 messages Jun 5, 2015 – Jul 15, 2015 Generic PHY framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 phy: ulpi_phy: Add const qualifier to ops

The ops is never changed in ulpi_phy_create(), so make it const.

---
 drivers/phy/ulpi_phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/ulpi_phy.h +1 -1
index ac49fb6..f2ebe49 100644
@@ -5,7 +5,7 @@
  * and it's controller, which is always the parent.
  */
 static inline struct phy
-*ulpi_phy_create(struct ulpi *ulpi, struct phy_ops *ops)
+*ulpi_phy_create(struct ulpi *ulpi, const struct phy_ops *ops)
 {
 	struct phy *phy;
 	int ret;
Signature · 1 line
2.1.0
author
#1 lore raw

2015-06-05 8:27 GMT+08:00 Axel Lin <[email protected]>:

Quoted 1 line

The ops is never changed in ulpi_phy_create(), so make it const.

Hi Kishon,

Would you pick up this patch?
Without this patch, passing a const struct phy_ops* to ulip_phy_create will have compiler warning.
It should be fine to pass a const struct phy_ops* to ulip_phy_create and since the drivers usually never change phy_ops after initialized, it can be const.

#2 lore raw

Hi Axel,

Quoted 6 lines · Axel Lin

2015-06-05 8:27 GMT+08:00 Axel Lin <[email protected]>:

Quoted 1 line

The ops is never changed in ulpi_phy_create(), so make it const.

Hi Kishon,

Would you pick up this patch?

yes.. I'll take once I start queuing the patches.

Thanks
Kishon