Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: Use of_device_get_match_data()

Use of_device_get_match_data() to simplify the code.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220221020233.1925154-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Minghao Chi (CGEL ZTE) and committed by
Mark Brown
c5a3106a 04378630

+1 -7
+1 -7
drivers/spi/spi-lantiq-ssc.c
··· 906 906 struct spi_master *master; 907 907 struct lantiq_ssc_spi *spi; 908 908 const struct lantiq_ssc_hwcfg *hwcfg; 909 - const struct of_device_id *match; 910 909 u32 id, supports_dma, revision; 911 910 unsigned int num_cs; 912 911 int err; 913 912 914 - match = of_match_device(lantiq_ssc_match, dev); 915 - if (!match) { 916 - dev_err(dev, "no device match\n"); 917 - return -EINVAL; 918 - } 919 - hwcfg = match->data; 913 + hwcfg = of_device_get_match_data(dev); 920 914 921 915 master = spi_alloc_master(dev, sizeof(struct lantiq_ssc_spi)); 922 916 if (!master)