@@ -795,14 +795,15 @@ static int s3c64xx_spi_setup(struct spi_device *spi)
int err;
sdd = spi_master_get_devdata(spi->master);
- if (!cs && spi->dev.of_node) {
+ if (spi->dev.of_node) {
cs = s3c64xx_get_slave_ctrldata(spi);
spi->controller_data = cs;
- }
-
- /* For the non-DT platforms derive chip selects from controller data */
- if (!spi->dev.of_node)
+ } else {
+ /* For the non-DT platforms derive chip
+ * selects from controller data
+ */
spi->cs_gpio = cs->line;
+ }
if (IS_ERR_OR_NULL(cs)) {
dev_err(&spi->dev, "No CS for SPI(%d)\n", spi->chip_select);