net: phy: constify phydev->drv
Device driver structures are shared between all devices that they match, and thus nothing should never write to the device driver structure through the phydev->drv pointer. Let's make this pointer const to catch code that attempts to do so. Suggested-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://lore.kernel.org/r/E1rVxXt-002YqY-9G@rmk-PC.armlinux.org.uk Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
03ba6dc035
commit
0bd199fd9c
+1
-1
@@ -638,7 +638,7 @@ struct phy_device {
|
||||
|
||||
/* Information about the PHY type */
|
||||
/* And management functions */
|
||||
struct phy_driver *drv;
|
||||
const struct phy_driver *drv;
|
||||
|
||||
struct device_link *devlink;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user