diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 581cec19cb77..d9e3d83fc7e8 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1281,6 +1282,11 @@ static int sh_msiof_spi_probe(struct platform_device *pdev) int i; int ret; + /* Check whether MSIOF is used as I2S mode or SPI mode by checking "port" node */ + struct device_node *port __free(device_node) = of_graph_get_next_port(dev->of_node, NULL); + if (port) /* It was MSIOF-I2S */ + return -ENODEV; + chipdata = of_device_get_match_data(dev); if (chipdata) { info = sh_msiof_spi_parse_dt(dev);