On Tue, 22 Jul 2008 12:28:00 -0700 David Brownell <[EMAIL PROTECTED]> wrote:

> From: Shadi Ammouri <[EMAIL PROTECTED]>
> Date: Fri, 27 Jun 2008 19:10:06 +0200
> Subject: [PATCH] spi: driver for Marvell Orion SPI controllers
> 
> This adds a SPI driver for the SPI controller found in various
> Marvell Orion ARM SoCs.  It currently supports only one slave,
> which must use SPI mode 0.
> 
> [ [EMAIL PROTECTED]: cleanups, meet specs, pass "sparse" ]
> Signed-off-by: Shadi Ammouri <[EMAIL PROTECTED]>
> Signed-off-by: Saeed Bishara <[EMAIL PROTECTED]>
> Signed-off-by: Lennert Buytenhek <[EMAIL PROTECTED]>
> Signed-off-by: David Brownell <[EMAIL PROTECTED]>
>
> ...
>
> +/*
> + * called only when no transfer is active on the bus
> + */
> +static int
> +orion_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
> +{
> +     struct orion_spi *orion_spi;
> +     unsigned int speed = spi->max_speed_hz;
> +     unsigned int bits_per_word = spi->bits_per_word;
> +
> +     orion_spi = spi_master_get_devdata(spi->master);
> +
> +     if ((t != NULL) && t->speed_hz)
> +             speed = t->speed_hz;
> +
> +     if ((t != NULL) && t->bits_per_word)
> +             bits_per_word = t->bits_per_word;
> +
> +     if (orion_spi_baudrate_set(spi, speed) != 0)
> +             return -EINVAL;
> +
> +     if (orion_spi_set_transfer_size(orion_spi, bits_per_word) != 0)
> +             return -EINVAL;

Given that orion_spi_baudrate_set() and orion_spi_set_transfer_size()
carefully return an -EFOO value, it's a bit unkind to just rub that out
and return a hard-coded -EINVAL.

> ...
>
> +static void __exit orion_spi_exit(void)
> +{
> +     platform_driver_unregister(&orion_spi_driver);
> +
> +     destroy_workqueue(orion_spi_wq);
> +}

Please double-check the workqueue handling.  Without looking at it too
closely, I think that this is waaaay too late to be running
destroy_workqueue().  If a work is still pending, all the data upon
which it will be operating will have been rubbed out.  I'm suspecting
that an earlier flush_work() (or similar) will be needed.



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to