# Re: \[net-next RFC PATCH 1/6\] net: phy: add support for defining multiple PHY IDs in PHY driver

- From: Andrew Lunn \<andrew@lunn.ch\>
- Date: 2024-02-18 20:10:47 
- List: netdev
- Page: https://ratatoskr.run/netdev/2024/02/2500981
- Thread: https://ratatoskr.run/netdev/2024/02/2500936/t.md

```text
> > > +	phy_dev_id = (struct mdio_device_id *)&phydev->dev_id;
> > 
> > Why this cast? Try to write code that doesn't need casts.
> > 
> 
> This cast is needed to keep the dev_id const in the phy_device struct so
> that other are warned to not modify it and should only be handled by
> phy_probe since it's the one that fills it.
> 
> Alternative is to drop const and drop the warning.

Can you propagate the const. Make phy_dev_id point to a const?

    Andrew
```
