diff options
author | Romain Naour <romain.naour@smile.fr> | 2024-10-08 09:54:25 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-10-27 10:19:44 -0600 |
commit | 5b87af441f8ef5e5c74fbb4337e1f42816b73189 (patch) | |
tree | 2d9b013fc78cdcd448d3d0a6aec95e91a8aefe36 /test/py/conftest.py | |
parent | 6df5c5aee3d1bcbb0a9a0d5cfd62609c8c3ec24c (diff) |
net: ksz9477: remove dev_set_parent_priv() call
The ksz9477 is currently the only driver using dev_set_parent_priv()
outside of the driver model. Also, there was no explanation in the
commit adding ksz9477 driver and why dev_set_parent_priv() is
required.
Actually there is a typo in ksz_mdio_probe() while retrieving
the parent (switch@0) private data:
- priv->ksz = dev_get_parent_priv(dev->parent);
+ priv->ksz = dev_get_priv(dev->parent);
Printing the address of struct ksz_dsa_priv *priv allows
to notice the slight difference:
ksz_i2c_probe: ksz_dsa_priv *priv 0xfdf45768 // address of the saved priv
ksz_mdio_bind: ksz_dsa_priv *priv 0xfdf45798 // address returned by dev_get_parent_priv(dev->parent)
ksz_mdio_bind: ksz_dsa_priv *priv 0xfdf45768 // address returned by dev_get_priv(dev->parent)
The ksz_mdio driver get the wrong data and without
dev_set_parent_priv() the mdio driver fail to access the underlying
bus.
While it doesn't cause any issue with I2C bus, it override the
per-child data used by the SPI bus (struct spi_slave) and prevent
further bus access (even with sspi command).
Signed-off-by: Romain Naour <romain.naour@smile.fr>
Diffstat (limited to 'test/py/conftest.py')
0 files changed, 0 insertions, 0 deletions