diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2014-12-03 01:56:17 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-12-03 08:05:47 -0500 |
commit | c592becbe704127ef0b89233ff7f285637491154 (patch) | |
tree | cca527460f97f6879e7eb73d010faccf77cd3a2d /drivers/spi/spi-fsl-spi.c | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
spi: fsl-(e)spi: migrate to generic master queueing
Migrates the fsl-(e)spi driver to use the generic master queuing.
Avoids the "master is unqueued, this is deprecated" warning.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-fsl-spi.c')
-rw-r--r-- | drivers/spi/spi-fsl-spi.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index ed792880c9d6..6b94428a0223 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c | |||
@@ -353,7 +353,8 @@ static int fsl_spi_bufs(struct spi_device *spi, struct spi_transfer *t, | |||
353 | return mpc8xxx_spi->count; | 353 | return mpc8xxx_spi->count; |
354 | } | 354 | } |
355 | 355 | ||
356 | static void fsl_spi_do_one_msg(struct spi_message *m) | 356 | static int fsl_spi_do_one_msg(struct spi_master *master, |
357 | struct spi_message *m) | ||
357 | { | 358 | { |
358 | struct spi_device *spi = m->spi; | 359 | struct spi_device *spi = m->spi; |
359 | struct spi_transfer *t, *first; | 360 | struct spi_transfer *t, *first; |
@@ -408,8 +409,7 @@ static void fsl_spi_do_one_msg(struct spi_message *m) | |||
408 | } | 409 | } |
409 | 410 | ||
410 | m->status = status; | 411 | m->status = status; |
411 | if (m->complete) | 412 | spi_finalize_current_message(master); |
412 | m->complete(m->context); | ||
413 | 413 | ||
414 | if (status || !cs_change) { | 414 | if (status || !cs_change) { |
415 | ndelay(nsecs); | 415 | ndelay(nsecs); |
@@ -417,6 +417,7 @@ static void fsl_spi_do_one_msg(struct spi_message *m) | |||
417 | } | 417 | } |
418 | 418 | ||
419 | fsl_spi_setup_transfer(spi, NULL); | 419 | fsl_spi_setup_transfer(spi, NULL); |
420 | return 0; | ||
420 | } | 421 | } |
421 | 422 | ||
422 | static int fsl_spi_setup(struct spi_device *spi) | 423 | static int fsl_spi_setup(struct spi_device *spi) |
@@ -624,15 +625,13 @@ static struct spi_master * fsl_spi_probe(struct device *dev, | |||
624 | 625 | ||
625 | dev_set_drvdata(dev, master); | 626 | dev_set_drvdata(dev, master); |
626 | 627 | ||
627 | ret = mpc8xxx_spi_probe(dev, mem, irq); | 628 | mpc8xxx_spi_probe(dev, mem, irq); |
628 | if (ret) | ||
629 | goto err_probe; | ||
630 | 629 | ||
631 | master->setup = fsl_spi_setup; | 630 | master->setup = fsl_spi_setup; |
632 | master->cleanup = fsl_spi_cleanup; | 631 | master->cleanup = fsl_spi_cleanup; |
632 | master->transfer_one_message = fsl_spi_do_one_msg; | ||
633 | 633 | ||
634 | mpc8xxx_spi = spi_master_get_devdata(master); | 634 | mpc8xxx_spi = spi_master_get_devdata(master); |
635 | mpc8xxx_spi->spi_do_one_msg = fsl_spi_do_one_msg; | ||
636 | mpc8xxx_spi->spi_remove = fsl_spi_remove; | 635 | mpc8xxx_spi->spi_remove = fsl_spi_remove; |
637 | mpc8xxx_spi->max_bits_per_word = 32; | 636 | mpc8xxx_spi->max_bits_per_word = 32; |
638 | mpc8xxx_spi->type = fsl_spi_get_type(dev); | 637 | mpc8xxx_spi->type = fsl_spi_get_type(dev); |
@@ -704,7 +703,6 @@ free_irq: | |||
704 | err_ioremap: | 703 | err_ioremap: |
705 | fsl_spi_cpm_free(mpc8xxx_spi); | 704 | fsl_spi_cpm_free(mpc8xxx_spi); |
706 | err_cpm_init: | 705 | err_cpm_init: |
707 | err_probe: | ||
708 | spi_master_put(master); | 706 | spi_master_put(master); |
709 | err: | 707 | err: |
710 | return ERR_PTR(ret); | 708 | return ERR_PTR(ret); |