mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
can: hi311x: simplify with spi_get_device_match_data()
Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/all/20240606142424.129709-1-krzysztof.kozlowski@linaro.org [mkl: add intermediate cast to uintptr_t] Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
3ba5caf39d
commit
1562a49d00
|
|
@ -830,7 +830,6 @@ static int hi3110_can_probe(struct spi_device *spi)
|
|||
struct device *dev = &spi->dev;
|
||||
struct net_device *net;
|
||||
struct hi3110_priv *priv;
|
||||
const void *match;
|
||||
struct clk *clk;
|
||||
u32 freq;
|
||||
int ret;
|
||||
|
|
@ -874,11 +873,7 @@ static int hi3110_can_probe(struct spi_device *spi)
|
|||
CAN_CTRLMODE_LISTENONLY |
|
||||
CAN_CTRLMODE_BERR_REPORTING;
|
||||
|
||||
match = device_get_match_data(dev);
|
||||
if (match)
|
||||
priv->model = (enum hi3110_model)(uintptr_t)match;
|
||||
else
|
||||
priv->model = spi_get_device_id(spi)->driver_data;
|
||||
priv->model = (enum hi3110_model)(uintptr_t)spi_get_device_match_data(spi);
|
||||
priv->net = net;
|
||||
priv->clk = clk;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user