diff options
-rw-r--r-- | drivers/spi/spi-rspi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 58449ad4ad0d..b60862f58534 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c @@ -958,8 +958,9 @@ static int rspi_probe(struct platform_device *pdev) INIT_WORK(&rspi->ws, rspi_work); init_waitqueue_head(&rspi->wait); - master->num_chipselect = rspi_pd->num_chipselect; - if (!master->num_chipselect) + if (rspi_pd && rspi_pd->num_chipselect) + master->num_chipselect = rspi_pd->num_chipselect; + else master->num_chipselect = 2; /* default */ master->bus_num = pdev->id; |