Commit dc64d98a authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Marc Kleine-Budde

can: hi311x: hi3110_can_probe(): make use of device property API

Make use of device property API in this driver so that both OF based
system and ACPI based system can use this driver.

Link: https://lore.kernel.org/all/20211206165542.69887-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 3a1ae63a
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
...@@ -828,11 +828,10 @@ MODULE_DEVICE_TABLE(spi, hi3110_id_table); ...@@ -828,11 +828,10 @@ MODULE_DEVICE_TABLE(spi, hi3110_id_table);
static int hi3110_can_probe(struct spi_device *spi) static int hi3110_can_probe(struct spi_device *spi)
{ {
const struct of_device_id *of_id = of_match_device(hi3110_of_match,
&spi->dev);
struct device *dev = &spi->dev; struct device *dev = &spi->dev;
struct net_device *net; struct net_device *net;
struct hi3110_priv *priv; struct hi3110_priv *priv;
const void *match;
struct clk *clk; struct clk *clk;
u32 freq; u32 freq;
int ret; int ret;
...@@ -877,8 +876,9 @@ static int hi3110_can_probe(struct spi_device *spi) ...@@ -877,8 +876,9 @@ static int hi3110_can_probe(struct spi_device *spi)
CAN_CTRLMODE_LISTENONLY | CAN_CTRLMODE_LISTENONLY |
CAN_CTRLMODE_BERR_REPORTING; CAN_CTRLMODE_BERR_REPORTING;
if (of_id) match = device_get_match_data(dev);
priv->model = (enum hi3110_model)(uintptr_t)of_id->data; if (match)
priv->model = (enum hi3110_model)(uintptr_t)match;
else else
priv->model = spi_get_device_id(spi)->driver_data; priv->model = spi_get_device_id(spi)->driver_data;
priv->net = net; priv->net = net;
......
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