diff mbox series

[v3,3/3] ASoC: tlv320aic32x4-spi: Simplify probe()

Message ID 20230831194622.87653-4-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Commit c6d86149db94c0289b0e5950fa23c5b19031ab8d
Headers show
Series Match data improvements for tlv320aic32x4 driver | expand

Commit Message

Biju Das Aug. 31, 2023, 7:46 p.m. UTC
Simplify probe() by replacing of_match_node() and spi_get_device_id() with
spi_get_device_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3:
 * New patch
---
 sound/soc/codecs/tlv320aic32x4-spi.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/tlv320aic32x4-spi.c b/sound/soc/codecs/tlv320aic32x4-spi.c
index 81c05030dd3b..d5976c91766e 100644
--- a/sound/soc/codecs/tlv320aic32x4-spi.c
+++ b/sound/soc/codecs/tlv320aic32x4-spi.c
@@ -16,8 +16,6 @@ 
 
 #include "tlv320aic32x4.h"
 
-static const struct of_device_id aic32x4_of_id[];
-
 static int aic32x4_spi_probe(struct spi_device *spi)
 {
 	struct regmap *regmap;
@@ -31,18 +29,7 @@  static int aic32x4_spi_probe(struct spi_device *spi)
 	config.read_flag_mask = 0x01;
 
 	regmap = devm_regmap_init_spi(spi, &config);
-
-	if (spi->dev.of_node) {
-		const struct of_device_id *oid;
-
-		oid = of_match_node(aic32x4_of_id, spi->dev.of_node);
-		type = (uintptr_t)oid->data;
-	} else {
-		const struct spi_device_id *id_entry;
-
-		id_entry = spi_get_device_id(spi);
-		type = id_entry->driver_data;
-	}
+	type = (uintptr_t)spi_get_device_match_data(spi);
 
 	return aic32x4_probe(&spi->dev, regmap, type);
 }