diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 7240c8608256..fe4d2da77301 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -14,9 +14,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -1393,13 +1393,9 @@ static int sc16is7xx_spi_probe(struct spi_device *spi) return ret; if (spi->dev.of_node) { - const struct of_device_id *of_id = - of_match_device(sc16is7xx_dt_ids, &spi->dev); - - if (!of_id) + devtype = device_get_match_data(&spi->dev); + if (!devtype) return -ENODEV; - - devtype = (struct sc16is7xx_devtype *)of_id->data; } else { const struct spi_device_id *id_entry = spi_get_device_id(spi); @@ -1454,13 +1450,9 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c, struct regmap *regmap; if (i2c->dev.of_node) { - const struct of_device_id *of_id = - of_match_device(sc16is7xx_dt_ids, &i2c->dev); - - if (!of_id) + devtype = device_get_match_data(&i2c->dev); + if (!devtype) return -ENODEV; - - devtype = (struct sc16is7xx_devtype *)of_id->data; } else { devtype = (struct sc16is7xx_devtype *)id->driver_data; flags = IRQF_TRIGGER_FALLING;