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>
This commit is contained in:
Minghao Chi (CGEL ZTE) 2022-02-21 02:02:33 +00:00 committed by Mark Brown
parent 043786303b
commit c5a3106aa4
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 1 additions and 7 deletions

View File

@ -906,17 +906,11 @@ static int lantiq_ssc_probe(struct platform_device *pdev)
struct spi_master *master; struct spi_master *master;
struct lantiq_ssc_spi *spi; struct lantiq_ssc_spi *spi;
const struct lantiq_ssc_hwcfg *hwcfg; const struct lantiq_ssc_hwcfg *hwcfg;
const struct of_device_id *match;
u32 id, supports_dma, revision; u32 id, supports_dma, revision;
unsigned int num_cs; unsigned int num_cs;
int err; int err;
match = of_match_device(lantiq_ssc_match, dev); hwcfg = of_device_get_match_data(dev);
if (!match) {
dev_err(dev, "no device match\n");
return -EINVAL;
}
hwcfg = match->data;
master = spi_alloc_master(dev, sizeof(struct lantiq_ssc_spi)); master = spi_alloc_master(dev, sizeof(struct lantiq_ssc_spi));
if (!master) if (!master)