diff options
author | Rob Herring <robh@kernel.org> | 2023-10-09 12:29:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-13 10:05:49 +0100 |
commit | 13266ad9e52e2e51b0f068b0251a1d5c2badae5c (patch) | |
tree | 20c650592da7dc2a1154ee6af8f6b44693b75b40 /drivers | |
parent | b0377116decdeecb8c6a928d59cd4bea00a4af6e (diff) |
net: ethernet: wiznet: Use spi_get_device_match_data()
Use preferred spi_get_device_match_data() instead of of_match_device() and
spi_get_device_id() to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/wiznet/w5100-spi.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/ethernet/wiznet/w5100-spi.c b/drivers/net/ethernet/wiznet/w5100-spi.c index 7c52796273a4..990a3cce8c0f 100644 --- a/drivers/net/ethernet/wiznet/w5100-spi.c +++ b/drivers/net/ethernet/wiznet/w5100-spi.c @@ -14,8 +14,8 @@ #include <linux/module.h> #include <linux/delay.h> #include <linux/netdevice.h> +#include <linux/of.h> #include <linux/of_net.h> -#include <linux/of_device.h> #include <linux/spi/spi.h> #include "w5100.h" @@ -420,7 +420,6 @@ MODULE_DEVICE_TABLE(of, w5100_of_match); static int w5100_spi_probe(struct spi_device *spi) { - const struct of_device_id *of_id; const struct w5100_ops *ops; kernel_ulong_t driver_data; const void *mac = NULL; @@ -432,14 +431,7 @@ static int w5100_spi_probe(struct spi_device *spi) if (!ret) mac = tmpmac; - if (spi->dev.of_node) { - of_id = of_match_device(w5100_of_match, &spi->dev); - if (!of_id) - return -ENODEV; - driver_data = (kernel_ulong_t)of_id->data; - } else { - driver_data = spi_get_device_id(spi)->driver_data; - } + driver_data = (uintptr_t)spi_get_device_match_data(spi); switch (driver_data) { case W5100: |