diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/Kconfig | 13 | ||||
-rw-r--r-- | drivers/spi/atmel_spi.c | 14 | ||||
-rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/omap2_mcspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/omap_uwire.c | 9 | ||||
-rw-r--r-- | drivers/spi/pxa2xx_spi.c | 14 | ||||
-rw-r--r-- | drivers/spi/spi.c | 43 | ||||
-rw-r--r-- | drivers/spi/spi_bfin5xx.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi_bitbang.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi_imx.c | 13 | ||||
-rw-r--r-- | drivers/spi/spi_lm70llp.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi_mpc83xx.c | 7 | ||||
-rw-r--r-- | drivers/spi/spi_s3c24xx.c | 9 | ||||
-rw-r--r-- | drivers/spi/spi_txx9.c | 2 |
14 files changed, 62 insertions, 75 deletions
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index b91571122da..a77ede598d3 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -124,16 +124,17 @@ config SPI_MPC52xx_PSC Controller in master SPI mode. config SPI_MPC83xx - tristate "Freescale MPC83xx SPI controller" - depends on SPI_MASTER && PPC_83xx && EXPERIMENTAL + tristate "Freescale MPC83xx/QUICC Engine SPI controller" + depends on SPI_MASTER && (PPC_83xx || QUICC_ENGINE) && EXPERIMENTAL select SPI_BITBANG help - This enables using the Freescale MPC83xx SPI controller in master - mode. + This enables using the Freescale MPC83xx and QUICC Engine SPI + controllers in master mode. Note, this driver uniquely supports the SPI controller on the MPC83xx - family of PowerPC processors. The MPC83xx uses a simple set of shift - registers for data (opposed to the CPM based descriptor model). + family of PowerPC processors, plus processors with QUICC Engine + technology. This driver uses a simple set of shift registers for data + (opposed to the CPM based descriptor model). config SPI_OMAP_UWIRE tristate "OMAP1 MicroWire" diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index b0469749310..0d342dcdd30 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c @@ -211,7 +211,7 @@ static void atmel_spi_next_message(struct spi_master *master) msg = list_entry(as->queue.next, struct spi_message, queue); spi = msg->spi; - dev_dbg(master->cdev.dev, "start message %p for %s\n", + dev_dbg(master->dev.parent, "start message %p for %s\n", msg, spi->dev.bus_id); /* select chip if it's not still active */ @@ -266,10 +266,10 @@ static void atmel_spi_dma_unmap_xfer(struct spi_master *master, struct spi_transfer *xfer) { if (xfer->tx_dma != INVALID_DMA_ADDRESS) - dma_unmap_single(master->cdev.dev, xfer->tx_dma, + dma_unmap_single(master->dev.parent, xfer->tx_dma, xfer->len, DMA_TO_DEVICE); if (xfer->rx_dma != INVALID_DMA_ADDRESS) - dma_unmap_single(master->cdev.dev, xfer->rx_dma, + dma_unmap_single(master->dev.parent, xfer->rx_dma, xfer->len, DMA_FROM_DEVICE); } @@ -285,7 +285,7 @@ atmel_spi_msg_done(struct spi_master *master, struct atmel_spi *as, list_del(&msg->queue); msg->status = status; - dev_dbg(master->cdev.dev, + dev_dbg(master->dev.parent, "xfer complete: %u bytes transferred\n", msg->actual_length); @@ -348,7 +348,7 @@ atmel_spi_interrupt(int irq, void *dev_id) if (xfer->delay_usecs) udelay(xfer->delay_usecs); - dev_warn(master->cdev.dev, "fifo overrun (%u/%u remaining)\n", + dev_warn(master->dev.parent, "fifo overrun (%u/%u remaining)\n", spi_readl(as, TCR), spi_readl(as, RCR)); /* @@ -363,7 +363,7 @@ atmel_spi_interrupt(int irq, void *dev_id) if (spi_readl(as, SR) & SPI_BIT(TXEMPTY)) break; if (!timeout) - dev_warn(master->cdev.dev, + dev_warn(master->dev.parent, "timeout waiting for TXEMPTY"); while (spi_readl(as, SR) & SPI_BIT(RDRF)) spi_readl(as, RDR); @@ -526,7 +526,7 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg) struct atmel_spi *as; struct spi_transfer *xfer; unsigned long flags; - struct device *controller = spi->master->cdev.dev; + struct device *controller = spi->master->dev.parent; as = spi_master_get_devdata(spi->master); diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index d2a4b2bdb07..e9aba932f21 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c @@ -503,7 +503,7 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, INIT_LIST_HEAD(&mps->queue); mps->workqueue = create_singlethread_workqueue( - master->cdev.dev->bus_id); + master->dev.parent->bus_id); if (mps->workqueue == NULL) { ret = -EBUSY; goto free_irq; diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 6b357cdb9ea..3cdab131c4a 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -645,7 +645,7 @@ static int omap2_mcspi_setup(struct spi_device *spi) clk_enable(mcspi->ick); clk_enable(mcspi->fck); - ret = omap2_mcspi_setup_transfer(spi, NULL); + ret = omap2_mcspi_setup_transfer(spi, NULL); clk_disable(mcspi->fck); clk_disable(mcspi->ick); @@ -693,7 +693,6 @@ static void omap2_mcspi_work(struct work_struct *work) struct spi_device *spi; struct spi_transfer *t = NULL; int cs_active = 0; - struct omap2_mcspi_device_config *conf; struct omap2_mcspi_cs *cs; int par_override = 0; int status = 0; @@ -706,7 +705,6 @@ static void omap2_mcspi_work(struct work_struct *work) spin_unlock_irq(&mcspi->lock); spi = m->spi; - conf = spi->controller_data; cs = spi->controller_state; omap2_mcspi_set_enable(spi, 1); diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c index d275c615a73..8245b5153f3 100644 --- a/drivers/spi/omap_uwire.c +++ b/drivers/spi/omap_uwire.c @@ -481,7 +481,7 @@ static void uwire_off(struct uwire_spi *uwire) spi_master_put(uwire->bitbang.master); } -static int uwire_probe(struct platform_device *pdev) +static int __init uwire_probe(struct platform_device *pdev) { struct spi_master *master; struct uwire_spi *uwire; @@ -525,7 +525,7 @@ static int uwire_probe(struct platform_device *pdev) return status; } -static int uwire_remove(struct platform_device *pdev) +static int __exit uwire_remove(struct platform_device *pdev) { struct uwire_spi *uwire = dev_get_drvdata(&pdev->dev); int status; @@ -543,8 +543,7 @@ static struct platform_driver uwire_driver = { .bus = &platform_bus_type, .owner = THIS_MODULE, }, - .probe = uwire_probe, - .remove = uwire_remove, + .remove = __exit_p(uwire_remove), // suspend ... unuse ck // resume ... use ck }; @@ -566,7 +565,7 @@ static int __init omap_uwire_init(void) omap_writel(val | 0x00AAA000, OMAP730_IO_CONF_9); } - return platform_driver_register(&uwire_driver); + return platform_driver_probe(&uwire_driver, uwire_probe); } static void __exit omap_uwire_exit(void) diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index e51311b2da0..5f3d808cbc2 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c @@ -26,7 +26,6 @@ #include <linux/dma-mapping.h> #include <linux/spi/spi.h> #include <linux/workqueue.h> -#include <linux/errno.h> #include <linux/delay.h> #include <asm/io.h> @@ -1230,7 +1229,7 @@ static void cleanup(struct spi_device *spi) kfree(chip); } -static int init_queue(struct driver_data *drv_data) +static int __init init_queue(struct driver_data *drv_data) { INIT_LIST_HEAD(&drv_data->queue); spin_lock_init(&drv_data->lock); @@ -1243,7 +1242,7 @@ static int init_queue(struct driver_data *drv_data) INIT_WORK(&drv_data->pump_messages, pump_messages); drv_data->workqueue = create_singlethread_workqueue( - drv_data->master->cdev.dev->bus_id); + drv_data->master->dev.parent->bus_id); if (drv_data->workqueue == NULL) return -EBUSY; @@ -1318,7 +1317,7 @@ static int destroy_queue(struct driver_data *drv_data) return 0; } -static int pxa2xx_spi_probe(struct platform_device *pdev) +static int __init pxa2xx_spi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct pxa2xx_spi_master *platform_info; @@ -1622,8 +1621,7 @@ static struct platform_driver driver = { .bus = &platform_bus_type, .owner = THIS_MODULE, }, - .probe = pxa2xx_spi_probe, - .remove = __devexit_p(pxa2xx_spi_remove), + .remove = pxa2xx_spi_remove, .shutdown = pxa2xx_spi_shutdown, .suspend = pxa2xx_spi_suspend, .resume = pxa2xx_spi_resume, @@ -1631,9 +1629,7 @@ static struct platform_driver driver = { static int __init pxa2xx_spi_init(void) { - platform_driver_register(&driver); - - return 0; + return platform_driver_probe(&driver, pxa2xx_spi_probe); } module_init(pxa2xx_spi_init); diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index e84d2159794..89769ce16f8 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -67,14 +67,11 @@ static int spi_match_device(struct device *dev, struct device_driver *drv) return strncmp(spi->modalias, drv->name, BUS_ID_SIZE) == 0; } -static int spi_uevent(struct device *dev, char **envp, int num_envp, - char *buffer, int buffer_size) +static int spi_uevent(struct device *dev, struct kobj_uevent_env *env) { const struct spi_device *spi = to_spi_device(dev); - envp[0] = buffer; - snprintf(buffer, buffer_size, "MODALIAS=%s", spi->modalias); - envp[1] = NULL; + add_uevent_var(env, "MODALIAS=%s", spi->modalias); return 0; } @@ -207,7 +204,7 @@ struct spi_device *spi_new_device(struct spi_master *master, struct spi_board_info *chip) { struct spi_device *proxy; - struct device *dev = master->cdev.dev; + struct device *dev = master->dev.parent; int status; /* NOTE: caller did any chip->bus_num checks necessary. @@ -242,7 +239,7 @@ struct spi_device *spi_new_device(struct spi_master *master, proxy->modalias = chip->modalias; snprintf(proxy->dev.bus_id, sizeof proxy->dev.bus_id, - "%s.%u", master->cdev.class_id, + "%s.%u", master->dev.bus_id, chip->chip_select); proxy->dev.parent = dev; proxy->dev.bus = &spi_bus_type; @@ -341,18 +338,18 @@ static void scan_boardinfo(struct spi_master *master) /*-------------------------------------------------------------------------*/ -static void spi_master_release(struct class_device *cdev) +static void spi_master_release(struct device *dev) { struct spi_master *master; - master = container_of(cdev, struct spi_master, cdev); + master = container_of(dev, struct spi_master, dev); kfree(master); } static struct class spi_master_class = { .name = "spi_master", .owner = THIS_MODULE, - .release = spi_master_release, + .dev_release = spi_master_release, }; @@ -360,7 +357,7 @@ static struct class spi_master_class = { * spi_alloc_master - allocate SPI master controller * @dev: the controller, possibly using the platform_bus * @size: how much zeroed driver-private data to allocate; the pointer to this - * memory is in the class_data field of the returned class_device, + * memory is in the driver_data field of the returned device, * accessible with spi_master_get_devdata(). * Context: can sleep * @@ -386,9 +383,9 @@ struct spi_master *spi_alloc_master(struct device *dev, unsigned size) if (!master) return NULL; - class_device_initialize(&master->cdev); - master->cdev.class = &spi_master_class; - master->cdev.dev = get_device(dev); + device_initialize(&master->dev); + master->dev.class = &spi_master_class; + master->dev.parent = get_device(dev); spi_master_set_devdata(master, &master[1]); return master; @@ -418,7 +415,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master); int spi_register_master(struct spi_master *master) { static atomic_t dyn_bus_id = ATOMIC_INIT((1<<15) - 1); - struct device *dev = master->cdev.dev; + struct device *dev = master->dev.parent; int status = -ENODEV; int dynamic = 0; @@ -443,12 +440,12 @@ int spi_register_master(struct spi_master *master) /* register the device, then userspace will see it. * registration fails if the bus ID is in use. */ - snprintf(master->cdev.class_id, sizeof master->cdev.class_id, + snprintf(master->dev.bus_id, sizeof master->dev.bus_id, "spi%u", master->bus_num); - status = class_device_add(&master->cdev); + status = device_add(&master->dev); if (status < 0) goto done; - dev_dbg(dev, "registered master %s%s\n", master->cdev.class_id, + dev_dbg(dev, "registered master %s%s\n", master->dev.bus_id, dynamic ? " (dynamic)" : ""); /* populate children from any spi device tables */ @@ -481,8 +478,8 @@ void spi_unregister_master(struct spi_master *master) { int dummy; - dummy = device_for_each_child(master->cdev.dev, NULL, __unregister); - class_device_unregister(&master->cdev); + dummy = device_for_each_child(master->dev.parent, NULL, __unregister); + device_unregister(&master->dev); } EXPORT_SYMBOL_GPL(spi_unregister_master); @@ -498,13 +495,13 @@ EXPORT_SYMBOL_GPL(spi_unregister_master); */ struct spi_master *spi_busnum_to_master(u16 bus_num) { - struct class_device *cdev; + struct device *dev; struct spi_master *master = NULL; struct spi_master *m; down(&spi_master_class.sem); - list_for_each_entry(cdev, &spi_master_class.children, node) { - m = container_of(cdev, struct spi_master, cdev); + list_for_each_entry(dev, &spi_master_class.children, node) { + m = container_of(dev, struct spi_master, dev); if (m->bus_num == bus_num) { master = spi_master_get(m); break; diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index f540ed77a10..6cb71d74738 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c @@ -39,7 +39,6 @@ #include <linux/dma-mapping.h> #include <linux/spi/spi.h> #include <linux/workqueue.h> -#include <linux/errno.h> #include <linux/delay.h> #include <asm/io.h> @@ -1107,7 +1106,7 @@ static inline int init_queue(struct driver_data *drv_data) /* init messages workqueue */ INIT_WORK(&drv_data->pump_messages, pump_messages); drv_data->workqueue = - create_singlethread_workqueue(drv_data->master->cdev.dev->bus_id); + create_singlethread_workqueue(drv_data->master->dev.parent->bus_id); if (drv_data->workqueue == NULL) return -EBUSY; diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 0c85c984ccb..81639c6be1c 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c @@ -472,7 +472,7 @@ int spi_bitbang_start(struct spi_bitbang *bitbang) /* this task is the only thing to touch the SPI bits */ bitbang->busy = 0; bitbang->workqueue = create_singlethread_workqueue( - bitbang->master->cdev.dev->bus_id); + bitbang->master->dev.parent->bus_id); if (bitbang->workqueue == NULL) { status = -EBUSY; goto err1; diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index bd9177f51de..3b4650ae6f1 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c @@ -1361,7 +1361,7 @@ static void cleanup(struct spi_device *spi) kfree(spi_get_ctldata(spi)); } -static int init_queue(struct driver_data *drv_data) +static int __init init_queue(struct driver_data *drv_data) { INIT_LIST_HEAD(&drv_data->queue); spin_lock_init(&drv_data->lock); @@ -1374,7 +1374,7 @@ static int init_queue(struct driver_data *drv_data) INIT_WORK(&drv_data->work, pump_messages); drv_data->workqueue = create_singlethread_workqueue( - drv_data->master->cdev.dev->bus_id); + drv_data->master->dev.parent->bus_id); if (drv_data->workqueue == NULL) return -EBUSY; @@ -1444,7 +1444,7 @@ static int destroy_queue(struct driver_data *drv_data) return 0; } -static int spi_imx_probe(struct platform_device *pdev) +static int __init spi_imx_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct spi_imx_master *platform_info; @@ -1622,7 +1622,7 @@ err_no_mem: return status; } -static int __devexit spi_imx_remove(struct platform_device *pdev) +static int __exit spi_imx_remove(struct platform_device *pdev) { struct driver_data *drv_data = platform_get_drvdata(pdev); int irq; @@ -1739,8 +1739,7 @@ static struct platform_driver driver = { .bus = &platform_bus_type, .owner = THIS_MODULE, }, - .probe = spi_imx_probe, - .remove = __devexit_p(spi_imx_remove), + .remove = __exit_p(spi_imx_remove), .shutdown = spi_imx_shutdown, .suspend = spi_imx_suspend, .resume = spi_imx_resume, @@ -1748,7 +1747,7 @@ static struct platform_driver driver = { static int __init spi_imx_init(void) { - return platform_driver_register(&driver); + return platform_driver_probe(&driver, spi_imx_probe); } module_init(spi_imx_init); diff --git a/drivers/spi/spi_lm70llp.c b/drivers/spi/spi_lm70llp.c index 4ea68ac1611..39d8d8ad65c 100644 --- a/drivers/spi/spi_lm70llp.c +++ b/drivers/spi/spi_lm70llp.c @@ -82,7 +82,7 @@ struct spi_lm70llp { struct pardevice *pd; struct spi_device *spidev_lm70; struct spi_board_info info; - struct class_device *cdev; + //struct device *dev; }; /* REVISIT : ugly global ; provides "exclusive open" facility */ diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c index 32cda77b31c..4580b9cf625 100644 --- a/drivers/spi/spi_mpc83xx.c +++ b/drivers/spi/spi_mpc83xx.c @@ -511,7 +511,7 @@ err: return ret; } -static int __devexit mpc83xx_spi_remove(struct platform_device *dev) +static int __exit mpc83xx_spi_remove(struct platform_device *dev) { struct mpc83xx_spi *mpc83xx_spi; struct spi_master *master; @@ -529,8 +529,7 @@ static int __devexit mpc83xx_spi_remove(struct platform_device *dev) MODULE_ALIAS("mpc83xx_spi"); /* for platform bus hotplug */ static struct platform_driver mpc83xx_spi_driver = { - .probe = mpc83xx_spi_probe, - .remove = __devexit_p(mpc83xx_spi_remove), + .remove = __exit_p(mpc83xx_spi_remove), .driver = { .name = "mpc83xx_spi", }, @@ -538,7 +537,7 @@ static struct platform_driver mpc83xx_spi_driver = { static int __init mpc83xx_spi_init(void) { - return platform_driver_register(&mpc83xx_spi_driver); + return platform_driver_probe(&mpc83xx_spi_driver, mpc83xx_spi_probe); } static void __exit mpc83xx_spi_exit(void) diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index e9b683f7d7b..89d6685a5ca 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c @@ -233,7 +233,7 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev) return IRQ_HANDLED; } -static int s3c24xx_spi_probe(struct platform_device *pdev) +static int __init s3c24xx_spi_probe(struct platform_device *pdev) { struct s3c24xx_spi *hw; struct spi_master *master; @@ -382,7 +382,7 @@ static int s3c24xx_spi_probe(struct platform_device *pdev) return err; } -static int s3c24xx_spi_remove(struct platform_device *dev) +static int __exit s3c24xx_spi_remove(struct platform_device *dev) { struct s3c24xx_spi *hw = platform_get_drvdata(dev); @@ -429,8 +429,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev) MODULE_ALIAS("s3c2410_spi"); /* for platform bus hotplug */ static struct platform_driver s3c24xx_spidrv = { - .probe = s3c24xx_spi_probe, - .remove = s3c24xx_spi_remove, + .remove = __exit_p(s3c24xx_spi_remove), .suspend = s3c24xx_spi_suspend, .resume = s3c24xx_spi_resume, .driver = { @@ -441,7 +440,7 @@ static struct platform_driver s3c24xx_spidrv = { static int __init s3c24xx_spi_init(void) { - return platform_driver_register(&s3c24xx_spidrv); + return platform_driver_probe(&s3c24xx_spidrv, s3c24xx_spi_probe); } static void __exit s3c24xx_spi_exit(void) diff --git a/drivers/spi/spi_txx9.c b/drivers/spi/spi_txx9.c index b7f4bb239ea..cc5094f37dd 100644 --- a/drivers/spi/spi_txx9.c +++ b/drivers/spi/spi_txx9.c @@ -400,7 +400,7 @@ static int __init txx9spi_probe(struct platform_device *dev) goto exit; } - c->workqueue = create_singlethread_workqueue(master->cdev.dev->bus_id); + c->workqueue = create_singlethread_workqueue(master->dev.parent->bus_id); if (!c->workqueue) goto exit; c->last_chipselect = -1; |