net: dsa: microchip: remove the struct ksz8

This patch removes the struct ksz8 from ksz8.h which is no longer
needed. The platform bus specific details are now deferenced through
dev->priv.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Arun Ramadoss 2022-06-28 22:43:26 +05:30 committed by David S. Miller
parent 34e4838363
commit 47d82864ee
3 changed files with 4 additions and 27 deletions

View File

@ -12,10 +12,6 @@
#include <net/dsa.h>
#include "ksz_common.h"
struct ksz8 {
void *priv;
};
int ksz8_setup(struct dsa_switch *ds);
u32 ksz8_get_port_addr(int port, int offset);
void ksz8_cfg_port_member(struct ksz_device *dev, int port, u8 member);

View File

@ -26,11 +26,9 @@ static int ksz8863_mdio_read(void *ctx, const void *reg_buf, size_t reg_len,
struct mdio_device *mdev;
u8 reg = *(u8 *)reg_buf;
u8 *val = val_buf;
struct ksz8 *ksz8;
int i, ret = 0;
ksz8 = dev->priv;
mdev = ksz8->priv;
mdev = dev->priv;
mutex_lock_nested(&mdev->bus->mdio_lock, MDIO_MUTEX_NESTED);
for (i = 0; i < val_len; i++) {
@ -55,13 +53,11 @@ static int ksz8863_mdio_write(void *ctx, const void *data, size_t count)
{
struct ksz_device *dev = ctx;
struct mdio_device *mdev;
struct ksz8 *ksz8;
int i, ret = 0;
u32 reg;
u8 *val;
ksz8 = dev->priv;
mdev = ksz8->priv;
mdev = dev->priv;
val = (u8 *)(data + 4);
reg = *(u32 *)data;
@ -142,17 +138,10 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev)
{
struct regmap_config rc;
struct ksz_device *dev;
struct ksz8 *ksz8;
int ret;
int i;
ksz8 = devm_kzalloc(&mdiodev->dev, sizeof(struct ksz8), GFP_KERNEL);
if (!ksz8)
return -ENOMEM;
ksz8->priv = mdiodev;
dev = ksz_switch_alloc(&mdiodev->dev, ksz8);
dev = ksz_switch_alloc(&mdiodev->dev, mdiodev);
if (!dev)
return -ENOMEM;

View File

@ -14,7 +14,6 @@
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include "ksz8.h"
#include "ksz_common.h"
#define KSZ8795_SPI_ADDR_SHIFT 12
@ -45,16 +44,9 @@ static int ksz_spi_probe(struct spi_device *spi)
struct device *ddev = &spi->dev;
struct regmap_config rc;
struct ksz_device *dev;
struct ksz8 *ksz8;
int i, ret = 0;
ksz8 = devm_kzalloc(&spi->dev, sizeof(struct ksz8), GFP_KERNEL);
if (!ksz8)
return -ENOMEM;
ksz8->priv = spi;
dev = ksz_switch_alloc(&spi->dev, ksz8);
dev = ksz_switch_alloc(&spi->dev, spi);
if (!dev)
return -ENOMEM;