diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-02-02 17:04:44 +0000 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-02-08 11:38:14 +0000 |
commit | 84e88f42de5d159c70e8963a985ef4aab9888f12 (patch) | |
tree | 2f252f7269fb0e4ea3f35f2a07dddc79ea23b7a6 /include | |
parent | 9b1aa14b161b5edaa4ad775f32ed7214e442a66e (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/phy.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index 27a74a2d608a..bae7be7b44a1 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -637,7 +637,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; |