We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3504c31 commit 195f01dCopy full SHA for 195f01d
drivers/tty/serial/sc16is7xx.c
@@ -1742,15 +1742,9 @@ static int sc16is7xx_spi_probe(struct spi_device *spi)
1742
if (ret)
1743
return ret;
1744
1745
- if (spi->dev.of_node) {
1746
- devtype = device_get_match_data(&spi->dev);
1747
- if (!devtype)
1748
- return -ENODEV;
1749
- } else {
1750
- const struct spi_device_id *id_entry = spi_get_device_id(spi);
1751
-
1752
- devtype = (struct sc16is7xx_devtype *)id_entry->driver_data;
1753
- }
+ devtype = spi_get_device_match_data(spi);
+ if (!devtype)
+ return dev_err_probe(&spi->dev, -ENODEV, "Failed to match device\n");
1754
1755
for (i = 0; i < devtype->nr_uart; i++) {
1756
regcfg.name = sc16is7xx_regmap_name(i);
0 commit comments