Re: [PATCH 4/4] spi: omap2-mcspi: Handle error on gpio_request

2015-05-24 Thread Nicholas Mc Guire
On Sat, 23 May 2015, Michael Welling wrote:

 If a valid GPIO is specified but cannot be requested by the driver, print a
 message and error out of omap2_mcspi_setup.
 
 Signed-off-by: Michael Welling mwell...@ieee.org
 ---
  drivers/spi/spi-omap2-mcspi.c |9 ++---
  1 file changed, 6 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
 index c4e21ad..5867384 100644
 --- a/drivers/spi/spi-omap2-mcspi.c
 +++ b/drivers/spi/spi-omap2-mcspi.c
 @@ -1023,9 +1023,12 @@ static int omap2_mcspi_setup(struct spi_device *spi)
   }
  
   if (gpio_is_valid(spi-cs_gpio)) {
 - if (gpio_request(spi-cs_gpio, dev_name(spi-dev)) == 0)
 - gpio_direction_output(spi-cs_gpio,
 - !(spi-mode  SPI_CS_HIGH));
 + ret = gpio_request(spi-cs_gpio, dev_name(spi-dev));
 + if (ret) {
 + dev_err(spi-dev, failed to request gpio\n);
 + return ret;
 + }
 + gpio_direction_output(spi-cs_gpio, !(spi-mode  SPI_CS_HIGH));
   }

just wondering if the outer gpio_is_valid is actually needed as it seems
gpio_request() is actually calling gpio_is_valid() anyway and would return
non 0 if it were not,

thx!
hofrat
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mfd: twl6040: match wait_for_completion_timeout return type

2015-03-16 Thread Nicholas Mc Guire
Return type of wait_for_completion_timeout is unsigned long not int. As
time_left is exclusively used for wait_for_completion_timeout here its
type is simply changed to unsigned long.

Signed-off-by: Nicholas Mc Guire hof...@osadl.org
---

Patch was compile tested with x86_64_defconfig + CONFIG_TWL6040_CORE=y

Patch is against 4.0-rc3 (localversion-next is -next-20150316)

 drivers/mfd/twl6040.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index f71ee3d..d6f9761 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -259,7 +259,7 @@ static irqreturn_t twl6040_thint_handler(int irq, void 
*data)
 
 static int twl6040_power_up_automatic(struct twl6040 *twl6040)
 {
-   int time_left;
+   unsigned long time_left;
 
gpio_set_value(twl6040-audpwron, 1);
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html