Commit 47d82864 authored by Arun Ramadoss's avatar Arun Ramadoss Committed by David S. Miller

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: default avatarArun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34e48383
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
#include <net/dsa.h> #include <net/dsa.h>
#include "ksz_common.h" #include "ksz_common.h"
struct ksz8 {
void *priv;
};
int ksz8_setup(struct dsa_switch *ds); int ksz8_setup(struct dsa_switch *ds);
u32 ksz8_get_port_addr(int port, int offset); u32 ksz8_get_port_addr(int port, int offset);
void ksz8_cfg_port_member(struct ksz_device *dev, int port, u8 member); void ksz8_cfg_port_member(struct ksz_device *dev, int port, u8 member);
......
...@@ -26,11 +26,9 @@ static int ksz8863_mdio_read(void *ctx, const void *reg_buf, size_t reg_len, ...@@ -26,11 +26,9 @@ static int ksz8863_mdio_read(void *ctx, const void *reg_buf, size_t reg_len,
struct mdio_device *mdev; struct mdio_device *mdev;
u8 reg = *(u8 *)reg_buf; u8 reg = *(u8 *)reg_buf;
u8 *val = val_buf; u8 *val = val_buf;
struct ksz8 *ksz8;
int i, ret = 0; int i, ret = 0;
ksz8 = dev->priv; mdev = dev->priv;
mdev = ksz8->priv;
mutex_lock_nested(&mdev->bus->mdio_lock, MDIO_MUTEX_NESTED); mutex_lock_nested(&mdev->bus->mdio_lock, MDIO_MUTEX_NESTED);
for (i = 0; i < val_len; i++) { for (i = 0; i < val_len; i++) {
...@@ -55,13 +53,11 @@ static int ksz8863_mdio_write(void *ctx, const void *data, size_t count) ...@@ -55,13 +53,11 @@ static int ksz8863_mdio_write(void *ctx, const void *data, size_t count)
{ {
struct ksz_device *dev = ctx; struct ksz_device *dev = ctx;
struct mdio_device *mdev; struct mdio_device *mdev;
struct ksz8 *ksz8;
int i, ret = 0; int i, ret = 0;
u32 reg; u32 reg;
u8 *val; u8 *val;
ksz8 = dev->priv; mdev = dev->priv;
mdev = ksz8->priv;
val = (u8 *)(data + 4); val = (u8 *)(data + 4);
reg = *(u32 *)data; reg = *(u32 *)data;
...@@ -142,17 +138,10 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev) ...@@ -142,17 +138,10 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev)
{ {
struct regmap_config rc; struct regmap_config rc;
struct ksz_device *dev; struct ksz_device *dev;
struct ksz8 *ksz8;
int ret; int ret;
int i; int i;
ksz8 = devm_kzalloc(&mdiodev->dev, sizeof(struct ksz8), GFP_KERNEL); dev = ksz_switch_alloc(&mdiodev->dev, mdiodev);
if (!ksz8)
return -ENOMEM;
ksz8->priv = mdiodev;
dev = ksz_switch_alloc(&mdiodev->dev, ksz8);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include "ksz8.h"
#include "ksz_common.h" #include "ksz_common.h"
#define KSZ8795_SPI_ADDR_SHIFT 12 #define KSZ8795_SPI_ADDR_SHIFT 12
...@@ -45,16 +44,9 @@ static int ksz_spi_probe(struct spi_device *spi) ...@@ -45,16 +44,9 @@ static int ksz_spi_probe(struct spi_device *spi)
struct device *ddev = &spi->dev; struct device *ddev = &spi->dev;
struct regmap_config rc; struct regmap_config rc;
struct ksz_device *dev; struct ksz_device *dev;
struct ksz8 *ksz8;
int i, ret = 0; int i, ret = 0;
ksz8 = devm_kzalloc(&spi->dev, sizeof(struct ksz8), GFP_KERNEL); dev = ksz_switch_alloc(&spi->dev, spi);
if (!ksz8)
return -ENOMEM;
ksz8->priv = spi;
dev = ksz_switch_alloc(&spi->dev, ksz8);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment