Message ID | 1617258288-1490-1-git-send-email-tiantao6@hisilicon.com |
---|---|
State | Accepted |
Commit | 0e6521f13c297de32906ad7f691905803b2b2880 |
Headers | show |
Series | spi: orion: Use device_get_match_data() helper | expand |
On Thu, 1 Apr 2021 14:24:48 +0800, Tian Tao wrote:
> Use the device_get_match_data() helper instead of open coding.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: orion: Use device_get_match_data() helper
commit: 0e6521f13c297de32906ad7f691905803b2b2880
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c index 68ed7fd..d02c5c9 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)) {
Use the device_get_match_data() helper instead of open coding. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> --- drivers/spi/spi-orion.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)