diff options
author | Rob Herring <robh@kernel.org> | 2023-09-01 14:36:49 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2024-01-19 08:08:53 -0600 |
commit | 5e6c3454b40594c6f1d398254e7b4005494f9638 (patch) | |
tree | 109e2fd97bd35d171bfb98a262b1e0b645d81752 /drivers/net/can/xilinx_can.c | |
parent | 61c2ef4b6cb019946479baf0aeded648081bfb5c (diff) | |
download | linux-5e6c3454b40594c6f1d398254e7b4005494f9638.tar.gz linux-5e6c3454b40594c6f1d398254e7b4005494f9638.tar.bz2 linux-5e6c3454b40594c6f1d398254e7b4005494f9638.zip |
net: can: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.
Error checking for matching and match data was not necessary as matching
is always successful if we're already in probe and the match tables always
have data pointers.
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/net/can/xilinx_can.c')
-rw-r--r-- | drivers/net/can/xilinx_can.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index abe58f103043..3722eaa84234 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -20,8 +20,8 @@ #include <linux/module.h> #include <linux/netdevice.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/skbuff.h> #include <linux/spinlock.h> #include <linux/string.h> @@ -1726,8 +1726,7 @@ static int xcan_probe(struct platform_device *pdev) struct net_device *ndev; struct xcan_priv *priv; struct phy *transceiver; - const struct of_device_id *of_id; - const struct xcan_devtype_data *devtype = &xcan_axi_data; + const struct xcan_devtype_data *devtype; void __iomem *addr; int ret; int rx_max, tx_max; @@ -1741,9 +1740,7 @@ static int xcan_probe(struct platform_device *pdev) goto err; } - of_id = of_match_device(xcan_of_match, &pdev->dev); - if (of_id && of_id->data) - devtype = of_id->data; + devtype = device_get_match_data(&pdev->dev); hw_tx_max_property = devtype->flags & XCAN_FLAG_TX_MAILBOXES ? "tx-mailbox-count" : "tx-fifo-depth"; |