linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Misc qcom geni spi driver fixes
@ 2020-02-04 19:12 Stephen Boyd
       [not found] ` <20200204191206.97036-1-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Boyd @ 2020-02-04 19:12 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Andy Gross, Bjorn Andersson, linux-spi

Here's a small collection of qcom geni spi driver fixes that
simplify the code and aid debugging.

Stephen Boyd (3):
  spi: spi-geni-qcom: Let firmware specify irq trigger flags
  spi: spi-geni-qcom: Grow a dev pointer to simplify code
  spi: spi-geni-qcom: Drop of.h include

 drivers/spi/spi-geni-qcom.c | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

-- 
Sent by a computer, using git, on the internet

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

* [PATCH 1/3] spi: spi-geni-qcom: Let firmware specify irq trigger flags
       [not found] ` <20200204191206.97036-1-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2020-02-04 19:12   ` Stephen Boyd
       [not found]     ` <20200204191206.97036-2-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2020-02-11 15:51     ` Applied "spi: spi-geni-qcom: Let firmware specify irq trigger flags" to the spi tree Mark Brown
  2020-02-04 19:12   ` [PATCH 2/3] spi: spi-geni-qcom: Grow a dev pointer to simplify code Stephen Boyd
  2020-02-04 19:12   ` [PATCH 3/3] spi: spi-geni-qcom: Drop of.h include Stephen Boyd
  2 siblings, 2 replies; 10+ messages in thread
From: Stephen Boyd @ 2020-02-04 19:12 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andy Gross, Bjorn Andersson,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Girish Mahadevan, Dilip Kota,
	Alok Chauhan, Douglas Anderson

We don't need to force IRQF_TRIGGER_HIGH here as the DT or ACPI tables
should take care of this for us. Just use 0 instead so that we use the
flags from the firmware.

Cc: Girish Mahadevan <girishm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Dilip Kota <dkota-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Alok Chauhan <alokc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Signed-off-by: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 drivers/spi/spi-geni-qcom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 6f3d64a1a2b3..46e501fc87f3 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -585,8 +585,7 @@ static int spi_geni_probe(struct platform_device *pdev)
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-	ret = request_irq(mas->irq, geni_spi_isr,
-			IRQF_TRIGGER_HIGH, "spi_geni", spi);
+	ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(&pdev->dev), spi);
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-- 
Sent by a computer, using git, on the internet

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

* [PATCH 2/3] spi: spi-geni-qcom: Grow a dev pointer to simplify code
       [not found] ` <20200204191206.97036-1-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2020-02-04 19:12   ` [PATCH 1/3] spi: spi-geni-qcom: Let firmware specify irq trigger flags Stephen Boyd
@ 2020-02-04 19:12   ` Stephen Boyd
       [not found]     ` <20200204191206.97036-3-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2020-02-04 19:12   ` [PATCH 3/3] spi: spi-geni-qcom: Drop of.h include Stephen Boyd
  2 siblings, 1 reply; 10+ messages in thread
From: Stephen Boyd @ 2020-02-04 19:12 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andy Gross, Bjorn Andersson,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Girish Mahadevan, Dilip Kota,
	Alok Chauhan, Douglas Anderson

Some lines are long here. Use a struct dev pointer to shorten lines and
simplify code. The clk_get() call can fail because of EPROBE_DEFER
problems too, so just remove the error print message because it isn't
useful.

Cc: Girish Mahadevan <girishm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Dilip Kota <dkota-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Alok Chauhan <alokc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Signed-off-by: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 drivers/spi/spi-geni-qcom.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 46e501fc87f3..f0ca7f5ae714 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -536,6 +536,7 @@ static int spi_geni_probe(struct platform_device *pdev)
 	struct spi_geni_master *mas;
 	void __iomem *base;
 	struct clk *clk;
+	struct device *dev = &pdev->dev;
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
@@ -545,28 +546,25 @@ static int spi_geni_probe(struct platform_device *pdev)
 	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));
+	clk = devm_clk_get(dev, "se");
+	if (IS_ERR(clk))
 		return PTR_ERR(clk);
-	}
 
-	spi = spi_alloc_master(&pdev->dev, sizeof(*mas));
+	spi = spi_alloc_master(dev, sizeof(*mas));
 	if (!spi)
 		return -ENOMEM;
 
 	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);
+	mas->dev = dev;
+	mas->se.dev = dev;
+	mas->se.wrapper = dev_get_drvdata(dev->parent);
 	mas->se.base = base;
 	mas->se.clk = clk;
 
 	spi->bus_num = -1;
-	spi->dev.of_node = pdev->dev.of_node;
+	spi->dev.of_node = dev->of_node;
 	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;
@@ -579,13 +577,13 @@ static int spi_geni_probe(struct platform_device *pdev)
 
 	init_completion(&mas->xfer_done);
 	spin_lock_init(&mas->lock);
-	pm_runtime_enable(&pdev->dev);
+	pm_runtime_enable(dev);
 
 	ret = spi_geni_init(mas);
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-	ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(&pdev->dev), spi);
+	ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(dev), spi);
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
@@ -597,7 +595,7 @@ static int spi_geni_probe(struct platform_device *pdev)
 spi_geni_probe_free_irq:
 	free_irq(mas->irq, spi);
 spi_geni_probe_runtime_disable:
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_disable(dev);
 	spi_master_put(spi);
 	return ret;
 }
-- 
Sent by a computer, using git, on the internet

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

* [PATCH 3/3] spi: spi-geni-qcom: Drop of.h include
       [not found] ` <20200204191206.97036-1-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2020-02-04 19:12   ` [PATCH 1/3] spi: spi-geni-qcom: Let firmware specify irq trigger flags Stephen Boyd
  2020-02-04 19:12   ` [PATCH 2/3] spi: spi-geni-qcom: Grow a dev pointer to simplify code Stephen Boyd
@ 2020-02-04 19:12   ` Stephen Boyd
       [not found]     ` <20200204191206.97036-4-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2020-02-11 15:51     ` Applied "spi: spi-geni-qcom: Drop of.h include" to the spi tree Mark Brown
  2 siblings, 2 replies; 10+ messages in thread
From: Stephen Boyd @ 2020-02-04 19:12 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andy Gross, Bjorn Andersson,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Girish Mahadevan, Dilip Kota,
	Alok Chauhan, Douglas Anderson

This driver doesn't call any DT functions like of_get_property(). Remove
the of.h include as it isn't used.

Cc: Girish Mahadevan <girishm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Dilip Kota <dkota-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Alok Chauhan <alokc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Signed-off-by: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 drivers/spi/spi-geni-qcom.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index f0ca7f5ae714..c3972424af71 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -6,7 +6,6 @@
 #include <linux/io.h>
 #include <linux/log2.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/qcom-geni-se.h>
-- 
Sent by a computer, using git, on the internet

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

* Re: [PATCH 1/3] spi: spi-geni-qcom: Let firmware specify irq trigger flags
       [not found]     ` <20200204191206.97036-2-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2020-02-04 21:07       ` Doug Anderson
  0 siblings, 0 replies; 10+ messages in thread
From: Doug Anderson @ 2020-02-04 21:07 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Mark Brown, LKML, Andy Gross, Bjorn Andersson, linux-spi,
	Girish Mahadevan, Dilip Kota, Alok Chauhan

Hi,

On Tue, Feb 4, 2020 at 11:12 AM Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>
> We don't need to force IRQF_TRIGGER_HIGH here as the DT or ACPI tables
> should take care of this for us. Just use 0 instead so that we use the
> flags from the firmware.
>
> Cc: Girish Mahadevan <girishm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Dilip Kota <dkota-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Alok Chauhan <alokc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/spi/spi-geni-qcom.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

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

* Re: [PATCH 2/3] spi: spi-geni-qcom: Grow a dev pointer to simplify code
       [not found]     ` <20200204191206.97036-3-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2020-02-04 21:07       ` Doug Anderson
  2020-02-11 15:51       ` Applied "spi: spi-geni-qcom: Grow a dev pointer to simplify code" to the spi tree Mark Brown
  1 sibling, 0 replies; 10+ messages in thread
From: Doug Anderson @ 2020-02-04 21:07 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Mark Brown, LKML, Andy Gross, Bjorn Andersson, linux-spi,
	Girish Mahadevan, Dilip Kota, Alok Chauhan

Hi,

On Tue, Feb 4, 2020 at 11:12 AM Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>
> Some lines are long here. Use a struct dev pointer to shorten lines and
> simplify code. The clk_get() call can fail because of EPROBE_DEFER
> problems too, so just remove the error print message because it isn't
> useful.
>
> Cc: Girish Mahadevan <girishm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Dilip Kota <dkota-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Alok Chauhan <alokc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/spi/spi-geni-qcom.c | 24 +++++++++++-------------
>  1 file changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
> index 46e501fc87f3..f0ca7f5ae714 100644
> --- a/drivers/spi/spi-geni-qcom.c
> +++ b/drivers/spi/spi-geni-qcom.c
> @@ -536,6 +536,7 @@ static int spi_geni_probe(struct platform_device *pdev)
>         struct spi_geni_master *mas;
>         void __iomem *base;
>         struct clk *clk;
> +       struct device *dev = &pdev->dev;
>
>         irq = platform_get_irq(pdev, 0);
>         if (irq < 0)
> @@ -545,28 +546,25 @@ static int spi_geni_probe(struct platform_device *pdev)
>         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));
> +       clk = devm_clk_get(dev, "se");
> +       if (IS_ERR(clk))

There could be other errors besides -EPROBE_DEFER and devm_clk_get()
won't have printed in all cases.  ...but I agree that it seems highly
unlikely we'd ever hit any of those but highly likely we _would_ print
out a needless shout about -EPROBE_DEFER, so this is fine:

Reviewed-by: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

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

* Re: [PATCH 3/3] spi: spi-geni-qcom: Drop of.h include
       [not found]     ` <20200204191206.97036-4-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2020-02-04 21:08       ` Doug Anderson
  0 siblings, 0 replies; 10+ messages in thread
From: Doug Anderson @ 2020-02-04 21:08 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Mark Brown, LKML, Andy Gross, Bjorn Andersson, linux-spi,
	Girish Mahadevan, Dilip Kota, Alok Chauhan

Hi,

On Tue, Feb 4, 2020 at 11:12 AM Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote:
>
> This driver doesn't call any DT functions like of_get_property(). Remove
> the of.h include as it isn't used.
>
> Cc: Girish Mahadevan <girishm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Dilip Kota <dkota-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Alok Chauhan <alokc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
> Cc: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/spi/spi-geni-qcom.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

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

* Applied "spi: spi-geni-qcom: Drop of.h include" to the spi tree
  2020-02-04 19:12   ` [PATCH 3/3] spi: spi-geni-qcom: Drop of.h include Stephen Boyd
       [not found]     ` <20200204191206.97036-4-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2020-02-11 15:51     ` Mark Brown
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Brown @ 2020-02-11 15:51 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Alok Chauhan, Andy Gross, Bjorn Andersson, Dilip Kota,
	Douglas Anderson, Girish Mahadevan, linux-kernel, linux-spi,
	Mark Brown

The patch

   spi: spi-geni-qcom: Drop of.h include

has been applied to the spi tree at

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

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 875014cb79ea4251e8800994640be1a8012b4133 Mon Sep 17 00:00:00 2001
From: Stephen Boyd <swboyd@chromium.org>
Date: Tue, 4 Feb 2020 11:12:06 -0800
Subject: [PATCH] spi: spi-geni-qcom: Drop of.h include

This driver doesn't call any DT functions like of_get_property(). Remove
the of.h include as it isn't used.

Cc: Girish Mahadevan <girishm@codeaurora.org>
Cc: Dilip Kota <dkota@codeaurora.org>
Cc: Alok Chauhan <alokc@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200204191206.97036-4-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-geni-qcom.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index f0ca7f5ae714..c3972424af71 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -6,7 +6,6 @@
 #include <linux/io.h>
 #include <linux/log2.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/qcom-geni-se.h>
-- 
2.20.1

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

* Applied "spi: spi-geni-qcom: Grow a dev pointer to simplify code" to the spi tree
       [not found]     ` <20200204191206.97036-3-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
  2020-02-04 21:07       ` Doug Anderson
@ 2020-02-11 15:51       ` Mark Brown
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Brown @ 2020-02-11 15:51 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Alok Chauhan, Andy Gross, Bjorn Andersson, Dilip Kota,
	Douglas Anderson, Girish Mahadevan,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-spi-u79uwXL29TY76Z2rM5mHXA, Mark Brown

The patch

   spi: spi-geni-qcom: Grow a dev pointer to simplify code

has been applied to the spi tree at

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

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 ea1e5b3354b1610ac16a780535fbdabfda9e6912 Mon Sep 17 00:00:00 2001
From: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Date: Tue, 4 Feb 2020 11:12:05 -0800
Subject: [PATCH] spi: spi-geni-qcom: Grow a dev pointer to simplify code

Some lines are long here. Use a struct dev pointer to shorten lines and
simplify code. The clk_get() call can fail because of EPROBE_DEFER
problems too, so just remove the error print message because it isn't
useful.

Cc: Girish Mahadevan <girishm-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Dilip Kota <dkota-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Alok Chauhan <alokc-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Signed-off-by: Stephen Boyd <swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Reviewed-by: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Link: https://lore.kernel.org/r/20200204191206.97036-3-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org
Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/spi/spi-geni-qcom.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 46e501fc87f3..f0ca7f5ae714 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -536,6 +536,7 @@ static int spi_geni_probe(struct platform_device *pdev)
 	struct spi_geni_master *mas;
 	void __iomem *base;
 	struct clk *clk;
+	struct device *dev = &pdev->dev;
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
@@ -545,28 +546,25 @@ static int spi_geni_probe(struct platform_device *pdev)
 	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));
+	clk = devm_clk_get(dev, "se");
+	if (IS_ERR(clk))
 		return PTR_ERR(clk);
-	}
 
-	spi = spi_alloc_master(&pdev->dev, sizeof(*mas));
+	spi = spi_alloc_master(dev, sizeof(*mas));
 	if (!spi)
 		return -ENOMEM;
 
 	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);
+	mas->dev = dev;
+	mas->se.dev = dev;
+	mas->se.wrapper = dev_get_drvdata(dev->parent);
 	mas->se.base = base;
 	mas->se.clk = clk;
 
 	spi->bus_num = -1;
-	spi->dev.of_node = pdev->dev.of_node;
+	spi->dev.of_node = dev->of_node;
 	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;
@@ -579,13 +577,13 @@ static int spi_geni_probe(struct platform_device *pdev)
 
 	init_completion(&mas->xfer_done);
 	spin_lock_init(&mas->lock);
-	pm_runtime_enable(&pdev->dev);
+	pm_runtime_enable(dev);
 
 	ret = spi_geni_init(mas);
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-	ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(&pdev->dev), spi);
+	ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(dev), spi);
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
@@ -597,7 +595,7 @@ static int spi_geni_probe(struct platform_device *pdev)
 spi_geni_probe_free_irq:
 	free_irq(mas->irq, spi);
 spi_geni_probe_runtime_disable:
-	pm_runtime_disable(&pdev->dev);
+	pm_runtime_disable(dev);
 	spi_master_put(spi);
 	return ret;
 }
-- 
2.20.1

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

* Applied "spi: spi-geni-qcom: Let firmware specify irq trigger flags" to the spi tree
  2020-02-04 19:12   ` [PATCH 1/3] spi: spi-geni-qcom: Let firmware specify irq trigger flags Stephen Boyd
       [not found]     ` <20200204191206.97036-2-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2020-02-11 15:51     ` Mark Brown
  1 sibling, 0 replies; 10+ messages in thread
From: Mark Brown @ 2020-02-11 15:51 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Alok Chauhan, Andy Gross, Bjorn Andersson, Dilip Kota,
	Douglas Anderson, Girish Mahadevan, linux-kernel, linux-spi,
	Mark Brown

The patch

   spi: spi-geni-qcom: Let firmware specify irq trigger flags

has been applied to the spi tree at

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

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 ece9ef3b60cbc36237138af456b236d3d1d9b771 Mon Sep 17 00:00:00 2001
From: Stephen Boyd <swboyd@chromium.org>
Date: Tue, 4 Feb 2020 11:12:04 -0800
Subject: [PATCH] spi: spi-geni-qcom: Let firmware specify irq trigger flags

We don't need to force IRQF_TRIGGER_HIGH here as the DT or ACPI tables
should take care of this for us. Just use 0 instead so that we use the
flags from the firmware.

Cc: Girish Mahadevan <girishm@codeaurora.org>
Cc: Dilip Kota <dkota@codeaurora.org>
Cc: Alok Chauhan <alokc@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20200204191206.97036-2-swboyd@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-geni-qcom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 6f3d64a1a2b3..46e501fc87f3 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -585,8 +585,7 @@ static int spi_geni_probe(struct platform_device *pdev)
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-	ret = request_irq(mas->irq, geni_spi_isr,
-			IRQF_TRIGGER_HIGH, "spi_geni", spi);
+	ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(&pdev->dev), spi);
 	if (ret)
 		goto spi_geni_probe_runtime_disable;
 
-- 
2.20.1

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

end of thread, other threads:[~2020-02-11 15:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-04 19:12 [PATCH 0/3] Misc qcom geni spi driver fixes Stephen Boyd
     [not found] ` <20200204191206.97036-1-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2020-02-04 19:12   ` [PATCH 1/3] spi: spi-geni-qcom: Let firmware specify irq trigger flags Stephen Boyd
     [not found]     ` <20200204191206.97036-2-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2020-02-04 21:07       ` Doug Anderson
2020-02-11 15:51     ` Applied "spi: spi-geni-qcom: Let firmware specify irq trigger flags" to the spi tree Mark Brown
2020-02-04 19:12   ` [PATCH 2/3] spi: spi-geni-qcom: Grow a dev pointer to simplify code Stephen Boyd
     [not found]     ` <20200204191206.97036-3-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2020-02-04 21:07       ` Doug Anderson
2020-02-11 15:51       ` Applied "spi: spi-geni-qcom: Grow a dev pointer to simplify code" to the spi tree Mark Brown
2020-02-04 19:12   ` [PATCH 3/3] spi: spi-geni-qcom: Drop of.h include Stephen Boyd
     [not found]     ` <20200204191206.97036-4-swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2020-02-04 21:08       ` Doug Anderson
2020-02-11 15:51     ` Applied "spi: spi-geni-qcom: Drop of.h include" to the spi tree Mark Brown

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).