--- zzzz-none-000/linux-3.10.107/drivers/media/i2c/s5c73m3/s5c73m3-spi.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/i2c/s5c73m3/s5c73m3-spi.c 2021-02-04 17:41:59.000000000 +0000 @@ -27,6 +27,12 @@ #define S5C73M3_SPI_DRV_NAME "S5C73M3-SPI" +static const struct of_device_id s5c73m3_spi_ids[] = { + { .compatible = "samsung,s5c73m3" }, + { } +}; +MODULE_DEVICE_TABLE(of, s5c73m3_spi_ids); + enum spi_direction { SPI_DIR_RX, SPI_DIR_TX @@ -47,7 +53,7 @@ xfer.rx_buf = addr; if (spi_dev == NULL) { - dev_err(&spi_dev->dev, "SPI device is uninitialized\n"); + pr_err("SPI device is uninitialized\n"); return -ENODEV; } @@ -73,7 +79,7 @@ memset(padding, 0, sizeof(padding)); - for (i = 0; i < count ; i++) { + for (i = 0; i < count; i++) { r = spi_xmit(spi_dev, (void *)addr + j, tx_size, SPI_DIR_TX); if (r < 0) return r; @@ -98,7 +104,7 @@ unsigned int i, j = 0; int r = 0; - for (i = 0; i < count ; i++) { + for (i = 0; i < count; i++) { r = spi_xmit(spi_dev, addr + j, tx_size, SPI_DIR_RX); if (r < 0) return r; @@ -144,8 +150,7 @@ spidrv->remove = s5c73m3_spi_remove; spidrv->probe = s5c73m3_spi_probe; spidrv->driver.name = S5C73M3_SPI_DRV_NAME; - spidrv->driver.bus = &spi_bus_type; - spidrv->driver.owner = THIS_MODULE; + spidrv->driver.of_match_table = s5c73m3_spi_ids; return spi_register_driver(spidrv); }