linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks
       [not found] <1540485629-5970-1-git-send-email-alokc@codeaurora.org>
@ 2018-10-25 16:40 ` Alok Chauhan
  2018-10-25 20:00   ` Doug Anderson
                     ` (2 more replies)
  2018-10-25 16:40 ` [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function Alok Chauhan
  2018-10-25 16:53 ` [PATCH 0/2] spi-geni-qcom: Cleanup nitpicks and simplify probe function alokc
  2 siblings, 3 replies; 9+ messages in thread
From: Alok Chauhan @ 2018-10-25 16:40 UTC (permalink / raw)
  To: swboyd, dianders, Mark Brown, linux-spi, linux-kernel
  Cc: linux-arm-msm, Alok Chauhan

fixed the nitpicks.

Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
---
 drivers/spi/spi-geni-qcom.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 6432ecc..d1830fb 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -64,15 +64,13 @@
 #define TIMESTAMP_AFTER		BIT(3)
 #define POST_CMD_DELAY		BIT(4)
 
-/* SPI M_COMMAND OPCODE */
-enum spi_mcmd_code {
+enum spi_m_cmd_opcode {
 	CMD_NONE,
 	CMD_XFER,
 	CMD_CS,
 	CMD_CANCEL,
 };
 
-
 struct spi_geni_master {
 	struct geni_se se;
 	struct device *dev;
@@ -87,7 +85,7 @@ struct spi_geni_master {
 	struct completion xfer_done;
 	unsigned int oversampling;
 	spinlock_t lock;
-	unsigned int cur_mcmd;
+	enum spi_m_cmd_opcode cur_mcmd;
 	int irq;
 };
 
@@ -129,7 +127,7 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag)
 	struct spi_geni_master *mas = spi_master_get_devdata(slv->master);
 	struct spi_master *spi = dev_get_drvdata(mas->dev);
 	struct geni_se *se = &mas->se;
-	unsigned long timeout;
+	unsigned long time_left;
 
 	reinit_completion(&mas->xfer_done);
 	pm_runtime_get_sync(mas->dev);
@@ -142,8 +140,8 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag)
 	else
 		geni_se_setup_m_cmd(se, SPI_CS_DEASSERT, 0);
 
-	timeout = wait_for_completion_timeout(&mas->xfer_done, HZ);
-	if (!timeout)
+	time_left = wait_for_completion_timeout(&mas->xfer_done, HZ);
+	if (!time_left)
 		handle_fifo_timeout(spi, NULL);
 
 	pm_runtime_put(mas->dev);
@@ -485,7 +483,6 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 	struct geni_se *se = &mas->se;
 	u32 m_irq;
 	unsigned long flags;
-	irqreturn_t ret = IRQ_HANDLED;
 
 	if (mas->cur_mcmd == CMD_NONE)
 		return IRQ_NONE;
@@ -533,7 +530,7 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 
 	writel(m_irq, se->base + SE_GENI_M_IRQ_CLEAR);
 	spin_unlock_irqrestore(&mas->lock, flags);
-	return ret;
+	return IRQ_HANDLED;
 }
 
 static int spi_geni_probe(struct platform_device *pdev)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function
       [not found] <1540485629-5970-1-git-send-email-alokc@codeaurora.org>
  2018-10-25 16:40 ` [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks Alok Chauhan
@ 2018-10-25 16:40 ` Alok Chauhan
  2018-10-25 20:06   ` Doug Anderson
                     ` (2 more replies)
  2018-10-25 16:53 ` [PATCH 0/2] spi-geni-qcom: Cleanup nitpicks and simplify probe function alokc
  2 siblings, 3 replies; 9+ messages in thread
From: Alok Chauhan @ 2018-10-25 16:40 UTC (permalink / raw)
  To: swboyd, dianders, Mark Brown, linux-spi, linux-kernel
  Cc: linux-arm-msm, Alok Chauhan

Re-arrange existing APIs in probe function to
avoid using goto and remove redundant variables.

Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
---
 drivers/spi/spi-geni-qcom.c | 49 ++++++++++++++++++++++-----------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index d1830fb..fdb7cb88 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -535,11 +535,30 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 
 static int spi_geni_probe(struct platform_device *pdev)
 {
-	int ret;
+	int ret, irq;
 	struct spi_master *spi;
 	struct spi_geni_master *mas;
 	struct resource *res;
-	struct geni_se *se;
+	void __iomem *base;
+	struct clk *clk;
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
+		dev_err(&pdev->dev, "Err getting IRQ %d\n", irq);
+		return irq;
+	}
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	clk = devm_clk_get(&pdev->dev, "se");
+	if (IS_ERR(clk)) {
+		dev_err(&pdev->dev, "Err getting SE Core clk %ld\n",
+						PTR_ERR(clk));
+		return PTR_ERR(clk);
+	}
 
 	spi = spi_alloc_master(&pdev->dev, sizeof(*mas));
 	if (!spi)
@@ -547,27 +566,15 @@ static int spi_geni_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, spi);
 	mas = spi_master_get_devdata(spi);
+	mas->irq = irq;
 	mas->dev = &pdev->dev;
 	mas->se.dev = &pdev->dev;
 	mas->se.wrapper = dev_get_drvdata(pdev->dev.parent);
-	se = &mas->se;
+	mas->se.base = base;
+	mas->se.clk = clk;
 
 	spi->bus_num = -1;
 	spi->dev.of_node = pdev->dev.of_node;
-	mas->se.clk = devm_clk_get(&pdev->dev, "se");
-	if (IS_ERR(mas->se.clk)) {
-		ret = PTR_ERR(mas->se.clk);
-		dev_err(&pdev->dev, "Err getting SE Core clk %d\n", ret);
-		goto spi_geni_probe_err;
-	}
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	se->base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(se->base)) {
-		ret = PTR_ERR(se->base);
-		goto spi_geni_probe_err;
-	}
-
 	spi->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LOOP | SPI_CS_HIGH;
 	spi->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
 	spi->num_chipselect = 4;
@@ -586,13 +593,6 @@ static int spi_geni_probe(struct platform_device *pdev)
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-	mas->irq = platform_get_irq(pdev, 0);
-	if (mas->irq < 0) {
-		ret = mas->irq;
-		dev_err(&pdev->dev, "Err getting IRQ %d\n", ret);
-		goto spi_geni_probe_runtime_disable;
-	}
-
 	ret = request_irq(mas->irq, geni_spi_isr,
 			IRQF_TRIGGER_HIGH, "spi_geni", spi);
 	if (ret)
@@ -607,7 +607,6 @@ static int spi_geni_probe(struct platform_device *pdev)
 	free_irq(mas->irq, spi);
 spi_geni_probe_runtime_disable:
 	pm_runtime_disable(&pdev->dev);
-spi_geni_probe_err:
 	spi_master_put(spi);
 	return ret;
 }
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] spi-geni-qcom: Cleanup nitpicks and simplify probe function
       [not found] <1540485629-5970-1-git-send-email-alokc@codeaurora.org>
  2018-10-25 16:40 ` [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks Alok Chauhan
  2018-10-25 16:40 ` [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function Alok Chauhan
@ 2018-10-25 16:53 ` alokc
  2 siblings, 0 replies; 9+ messages in thread
From: alokc @ 2018-10-25 16:53 UTC (permalink / raw)
  To: swboyd, dianders, Mark Brown
  Cc: linux-arm-msm, linux-arm-msm-owner, linux-spi, linux-kernel

On 2018-10-25 22:10, Alok Chauhan wrote:
> This patch series fixed the following:
> * nitpicks from the previous review
>  (https://patchwork.kernel.org/patch/10624849/)
> * Cleanup probe function by re-arranging existing APIs to starting of
>   function and hence avoiding one goto jump and remove few redundant
>   variables.
> 
> Alok Chauhan (2):
>   spi: spi-geni-qcom: fix nitpicks
>   spi: spi-geni-qcom: Simplify probe function
> 
>  drivers/spi/spi-geni-qcom.c | 64 
> +++++++++++++++++++++------------------------
>  1 file changed, 30 insertions(+), 34 deletions(-)

Added more folks as some them got missed by get_maintainer.pl for this 
patch.

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks
  2018-10-25 16:40 ` [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks Alok Chauhan
@ 2018-10-25 20:00   ` Doug Anderson
  2018-11-04  2:35   ` Stephen Boyd
  2018-11-05 12:03   ` Applied "spi: spi-geni-qcom: fix nitpicks" to the spi tree Mark Brown
  2 siblings, 0 replies; 9+ messages in thread
From: Doug Anderson @ 2018-10-25 20:00 UTC (permalink / raw)
  To: alokc; +Cc: Stephen Boyd, Mark Brown, linux-spi, LKML, linux-arm-msm

Hi,
On Thu, Oct 25, 2018 at 9:40 AM Alok Chauhan <alokc@codeaurora.org> wrote:
>
> fixed the nitpicks.

I probably would have put more a proper sentence, like:

Fixed small nits that were pointed out on the mailing list.  No
functional change expected.

...but I guess it's up to Mark if he cares.


> @@ -533,7 +530,7 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
>
>         writel(m_irq, se->base + SE_GENI_M_IRQ_CLEAR);
>         spin_unlock_irqrestore(&mas->lock, flags);
> -       return ret;
> +       return IRQ_HANDLED;

I probably would have put a blank line before the return while I was
at it, but it's not a big deal to me.

Thanks for following up.

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function
  2018-10-25 16:40 ` [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function Alok Chauhan
@ 2018-10-25 20:06   ` Doug Anderson
  2018-11-04  2:36   ` Stephen Boyd
  2018-11-05 12:03   ` Applied "spi: spi-geni-qcom: Simplify probe function" to the spi tree Mark Brown
  2 siblings, 0 replies; 9+ messages in thread
From: Doug Anderson @ 2018-10-25 20:06 UTC (permalink / raw)
  To: alokc; +Cc: Stephen Boyd, Mark Brown, linux-spi, LKML, linux-arm-msm

Hi,

On Thu, Oct 25, 2018 at 9:40 AM Alok Chauhan <alokc@codeaurora.org> wrote:
>
> Re-arrange existing APIs in probe function to
> avoid using goto and remove redundant variables.
>
> Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
> ---
>  drivers/spi/spi-geni-qcom.c | 49 ++++++++++++++++++++++-----------------------
>  1 file changed, 24 insertions(+), 25 deletions(-)

I agree that this is what Stephen was looking for in his review
feedback.  I personally thought it was fine the way it was but I have
no objections to this.  Thanks for following up.

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks
  2018-10-25 16:40 ` [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks Alok Chauhan
  2018-10-25 20:00   ` Doug Anderson
@ 2018-11-04  2:35   ` Stephen Boyd
  2018-11-05 12:03   ` Applied "spi: spi-geni-qcom: fix nitpicks" to the spi tree Mark Brown
  2 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2018-11-04  2:35 UTC (permalink / raw)
  To: Alok Chauhan, Mark Brown, dianders, linux-kernel, linux-spi
  Cc: linux-arm-msm, Alok Chauhan

Quoting Alok Chauhan (2018-10-25 09:40:28)
> fixed the nitpicks.

Agree with Doug, this commit text needs work.

> 
> Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
> ---

Code is fine though.

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function
  2018-10-25 16:40 ` [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function Alok Chauhan
  2018-10-25 20:06   ` Doug Anderson
@ 2018-11-04  2:36   ` Stephen Boyd
  2018-11-05 12:03   ` Applied "spi: spi-geni-qcom: Simplify probe function" to the spi tree Mark Brown
  2 siblings, 0 replies; 9+ messages in thread
From: Stephen Boyd @ 2018-11-04  2:36 UTC (permalink / raw)
  To: Alok Chauhan, Mark Brown, dianders, linux-kernel, linux-spi
  Cc: linux-arm-msm, Alok Chauhan

Quoting Alok Chauhan (2018-10-25 09:40:29)
> Re-arrange existing APIs in probe function to
> avoid using goto and remove redundant variables.
> 
> Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Applied "spi: spi-geni-qcom: Simplify probe function" to the spi tree
  2018-10-25 16:40 ` [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function Alok Chauhan
  2018-10-25 20:06   ` Doug Anderson
  2018-11-04  2:36   ` Stephen Boyd
@ 2018-11-05 12:03   ` Mark Brown
  2 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-11-05 12:03 UTC (permalink / raw)
  To: Alok Chauhan
  Cc: Mark Brown, swboyd, dianders, Mark Brown, linux-spi,
	linux-kernel, linux-arm-msm, linux-spi

The patch

   spi: spi-geni-qcom: Simplify probe function

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 6a34e285de9afc4441ee81ce76865acd30ed9263 Mon Sep 17 00:00:00 2001
From: Alok Chauhan <alokc@codeaurora.org>
Date: Thu, 25 Oct 2018 22:10:29 +0530
Subject: [PATCH] spi: spi-geni-qcom: Simplify probe function

Re-arrange existing APIs in probe function to
avoid using goto and remove redundant variables.

Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-geni-qcom.c | 49 ++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index d1830fbf2fc6..fdb7cb88fb56 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -535,11 +535,30 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 
 static int spi_geni_probe(struct platform_device *pdev)
 {
-	int ret;
+	int ret, irq;
 	struct spi_master *spi;
 	struct spi_geni_master *mas;
 	struct resource *res;
-	struct geni_se *se;
+	void __iomem *base;
+	struct clk *clk;
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
+		dev_err(&pdev->dev, "Err getting IRQ %d\n", irq);
+		return irq;
+	}
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	clk = devm_clk_get(&pdev->dev, "se");
+	if (IS_ERR(clk)) {
+		dev_err(&pdev->dev, "Err getting SE Core clk %ld\n",
+						PTR_ERR(clk));
+		return PTR_ERR(clk);
+	}
 
 	spi = spi_alloc_master(&pdev->dev, sizeof(*mas));
 	if (!spi)
@@ -547,27 +566,15 @@ static int spi_geni_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, spi);
 	mas = spi_master_get_devdata(spi);
+	mas->irq = irq;
 	mas->dev = &pdev->dev;
 	mas->se.dev = &pdev->dev;
 	mas->se.wrapper = dev_get_drvdata(pdev->dev.parent);
-	se = &mas->se;
+	mas->se.base = base;
+	mas->se.clk = clk;
 
 	spi->bus_num = -1;
 	spi->dev.of_node = pdev->dev.of_node;
-	mas->se.clk = devm_clk_get(&pdev->dev, "se");
-	if (IS_ERR(mas->se.clk)) {
-		ret = PTR_ERR(mas->se.clk);
-		dev_err(&pdev->dev, "Err getting SE Core clk %d\n", ret);
-		goto spi_geni_probe_err;
-	}
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	se->base = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(se->base)) {
-		ret = PTR_ERR(se->base);
-		goto spi_geni_probe_err;
-	}
-
 	spi->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LOOP | SPI_CS_HIGH;
 	spi->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
 	spi->num_chipselect = 4;
@@ -586,13 +593,6 @@ static int spi_geni_probe(struct platform_device *pdev)
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-	mas->irq = platform_get_irq(pdev, 0);
-	if (mas->irq < 0) {
-		ret = mas->irq;
-		dev_err(&pdev->dev, "Err getting IRQ %d\n", ret);
-		goto spi_geni_probe_runtime_disable;
-	}
-
 	ret = request_irq(mas->irq, geni_spi_isr,
 			IRQF_TRIGGER_HIGH, "spi_geni", spi);
 	if (ret)
@@ -607,7 +607,6 @@ static int spi_geni_probe(struct platform_device *pdev)
 	free_irq(mas->irq, spi);
 spi_geni_probe_runtime_disable:
 	pm_runtime_disable(&pdev->dev);
-spi_geni_probe_err:
 	spi_master_put(spi);
 	return ret;
 }
-- 
2.19.0.rc2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Applied "spi: spi-geni-qcom: fix nitpicks" to the spi tree
  2018-10-25 16:40 ` [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks Alok Chauhan
  2018-10-25 20:00   ` Doug Anderson
  2018-11-04  2:35   ` Stephen Boyd
@ 2018-11-05 12:03   ` Mark Brown
  2 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-11-05 12:03 UTC (permalink / raw)
  To: Alok Chauhan
  Cc: Mark Brown, swboyd, dianders, Mark Brown, linux-spi,
	linux-kernel, linux-arm-msm, linux-spi

The patch

   spi: spi-geni-qcom: fix nitpicks

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0dccff3ce73aa6e9b1b4b0ddb3831c1d7fde9507 Mon Sep 17 00:00:00 2001
From: Alok Chauhan <alokc@codeaurora.org>
Date: Thu, 25 Oct 2018 22:10:28 +0530
Subject: [PATCH] spi: spi-geni-qcom: fix nitpicks

fixed the nitpicks.

Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-geni-qcom.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 6432ecc4e2ca..d1830fbf2fc6 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -64,15 +64,13 @@
 #define TIMESTAMP_AFTER		BIT(3)
 #define POST_CMD_DELAY		BIT(4)
 
-/* SPI M_COMMAND OPCODE */
-enum spi_mcmd_code {
+enum spi_m_cmd_opcode {
 	CMD_NONE,
 	CMD_XFER,
 	CMD_CS,
 	CMD_CANCEL,
 };
 
-
 struct spi_geni_master {
 	struct geni_se se;
 	struct device *dev;
@@ -87,7 +85,7 @@ struct spi_geni_master {
 	struct completion xfer_done;
 	unsigned int oversampling;
 	spinlock_t lock;
-	unsigned int cur_mcmd;
+	enum spi_m_cmd_opcode cur_mcmd;
 	int irq;
 };
 
@@ -129,7 +127,7 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag)
 	struct spi_geni_master *mas = spi_master_get_devdata(slv->master);
 	struct spi_master *spi = dev_get_drvdata(mas->dev);
 	struct geni_se *se = &mas->se;
-	unsigned long timeout;
+	unsigned long time_left;
 
 	reinit_completion(&mas->xfer_done);
 	pm_runtime_get_sync(mas->dev);
@@ -142,8 +140,8 @@ static void spi_geni_set_cs(struct spi_device *slv, bool set_flag)
 	else
 		geni_se_setup_m_cmd(se, SPI_CS_DEASSERT, 0);
 
-	timeout = wait_for_completion_timeout(&mas->xfer_done, HZ);
-	if (!timeout)
+	time_left = wait_for_completion_timeout(&mas->xfer_done, HZ);
+	if (!time_left)
 		handle_fifo_timeout(spi, NULL);
 
 	pm_runtime_put(mas->dev);
@@ -485,7 +483,6 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 	struct geni_se *se = &mas->se;
 	u32 m_irq;
 	unsigned long flags;
-	irqreturn_t ret = IRQ_HANDLED;
 
 	if (mas->cur_mcmd == CMD_NONE)
 		return IRQ_NONE;
@@ -533,7 +530,7 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 
 	writel(m_irq, se->base + SE_GENI_M_IRQ_CLEAR);
 	spin_unlock_irqrestore(&mas->lock, flags);
-	return ret;
+	return IRQ_HANDLED;
 }
 
 static int spi_geni_probe(struct platform_device *pdev)
-- 
2.19.0.rc2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-05 12:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1540485629-5970-1-git-send-email-alokc@codeaurora.org>
2018-10-25 16:40 ` [PATCH 1/2] spi: spi-geni-qcom: fix nitpicks Alok Chauhan
2018-10-25 20:00   ` Doug Anderson
2018-11-04  2:35   ` Stephen Boyd
2018-11-05 12:03   ` Applied "spi: spi-geni-qcom: fix nitpicks" to the spi tree Mark Brown
2018-10-25 16:40 ` [PATCH 2/2] spi: spi-geni-qcom: Simplify probe function Alok Chauhan
2018-10-25 20:06   ` Doug Anderson
2018-11-04  2:36   ` Stephen Boyd
2018-11-05 12:03   ` Applied "spi: spi-geni-qcom: Simplify probe function" to the spi tree Mark Brown
2018-10-25 16:53 ` [PATCH 0/2] spi-geni-qcom: Cleanup nitpicks and simplify probe function alokc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).