From: Tian Tao Date: Thu, 1 Apr 2021 06:24:48 +0000 (+0800) Subject: spi: orion: Use device_get_match_data() helper X-Git-Tag: v5.13-rc1~150^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e6521f13c297de32906ad7f691905803b2b2880;p=thirdparty%2Fkernel%2Flinux.git spi: orion: Use device_get_match_data() helper Use the device_get_match_data() helper instead of open coding. Signed-off-by: Tian Tao Link: https://lore.kernel.org/r/1617258288-1490-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index 68ed7fd642569..d02c5c9def20c 100644 --- a/drivers/spi/spi-orion.c +++ b/drivers/spi/spi-orion.c @@ -634,7 +634,6 @@ MODULE_DEVICE_TABLE(of, orion_spi_of_match_table); static int orion_spi_probe(struct platform_device *pdev) { - const struct of_device_id *of_id; const struct orion_spi_dev *devdata; struct spi_master *master; struct orion_spi *spi; @@ -676,9 +675,8 @@ static int orion_spi_probe(struct platform_device *pdev) spi->master = master; spi->dev = &pdev->dev; - of_id = of_match_device(orion_spi_of_match_table, &pdev->dev); - devdata = (of_id) ? of_id->data : &orion_spi_dev_data; - spi->devdata = devdata; + devdata = device_get_match_data(&pdev->dev); + spi->devdata = devdata ? devdata : &orion_spi_dev_data; spi->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(spi->clk)) {