Commit 195f01dd authored by Hugo Villeneuve's avatar Hugo Villeneuve Committed by Greg Kroah-Hartman
Browse files

serial: sc16is7xx: use spi_get_device_match_data()



Use preferred spi_get_device_match_data() instead of
device_get_match_data() and spi_get_device_id() to get the driver match
data.

Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20231221231823.2327894-8-hugo@hugovil.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3504c317
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -1742,15 +1742,9 @@ static int sc16is7xx_spi_probe(struct spi_device *spi)
	if (ret)
		return ret;

	if (spi->dev.of_node) {
		devtype = device_get_match_data(&spi->dev);
	devtype = spi_get_device_match_data(spi);
	if (!devtype)
			return -ENODEV;
	} else {
		const struct spi_device_id *id_entry = spi_get_device_id(spi);

		devtype = (struct sc16is7xx_devtype *)id_entry->driver_data;
	}
		return dev_err_probe(&spi->dev, -ENODEV, "Failed to match device\n");

	for (i = 0; i < devtype->nr_uart; i++) {
		regcfg.name = sc16is7xx_regmap_name(i);