summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-mt65xx.c
diff options
context:
space:
mode:
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>2022-04-07 13:44:22 +0200
committerMark Brown <broonie@kernel.org>2022-04-19 16:32:07 +0100
commit7f7cdef7288a7da117a54249b680b04f503f8a67 (patch)
tree6daeb81cc7188644c9c4edbe28276bc54aa59224 /drivers/spi/spi-mt65xx.c
parentace145802350e0f8eec4a40522a1b1d5a4f90114 (diff)
spi: mt65xx: Switch to device_get_match_data()
Instead of performing yet another match check in the probe function, simply switch to device_get_match_data(). This is a cleanup and brings no functional change. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20220407114428.167091-3-angelogioacchino.delregno@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-mt65xx.c')
-rw-r--r--drivers/spi/spi-mt65xx.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 4c84b67ac85c..4e0b520f9abe 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -1084,7 +1084,6 @@ static int mtk_spi_probe(struct platform_device *pdev)
{
struct spi_master *master;
struct mtk_spi *mdata;
- const struct of_device_id *of_id;
int i, irq, ret, addr_bits;
master = devm_spi_alloc_master(&pdev->dev, sizeof(*mdata));
@@ -1105,14 +1104,8 @@ static int mtk_spi_probe(struct platform_device *pdev)
master->set_cs_timing = mtk_spi_set_hw_cs_timing;
master->use_gpio_descriptors = true;
- of_id = of_match_node(mtk_spi_of_match, pdev->dev.of_node);
- if (!of_id) {
- dev_err(&pdev->dev, "failed to probe of_node\n");
- return -EINVAL;
- }
-
mdata = spi_master_get_devdata(master);
- mdata->dev_comp = of_id->data;
+ mdata->dev_comp = device_get_match_data(&pdev->dev);
if (mdata->dev_comp->enhance_timing)
master->mode_bits |= SPI_CS_HIGH;