Skip to contentSkip to conversation

spi/sirf: Let device core handle pinctrl

PATCH In review Mark Brown 2 participants 2 messages May 6, 2013 – May 7, 2013 1 message not in the archive SPI

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 spi/sirf: Let device core handle pinctrl

Since commit ab78029 (drivers/pinctrl: grab default handles from device core) we can rely on device core for handling pinctrl so remove devm_pinctrl_get_select_default() from the driver.

---
 drivers/spi/spi-sirf.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/spi/spi-sirf.c +1 -11
index f59d417..899dc3b 100644
@@ -19,7 +19,6 @@
 #include <linux/of_gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
-#include <linux/pinctrl/consumer.h>
 
 #define DRIVER_NAME "sirfsoc_spi"
 
@@ -127,7 +126,6 @@ struct sirfsoc_spi {
 	void __iomem *base;
 	u32 ctrl_freq;  /* SPI controller clock speed */
 	struct clk *clk;
-	struct pinctrl *p;
 
 	/* rx & tx bufs from the spi_transfer */
 	const void *tx;
@@ -558,15 +556,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	master->bus_num = pdev->id;
 	sspi->bitbang.master->dev.of_node = pdev->dev.of_node;
 
-	sspi->p = pinctrl_get_select_default(&pdev->dev);
-	ret = IS_ERR(sspi->p);
-	if (ret)
-		goto free_master;
-
 	sspi->clk = clk_get(&pdev->dev, NULL);
 	if (IS_ERR(sspi->clk)) {
 		ret = -EINVAL;
-		goto free_pin;
+		goto free_master;
 	}
 	clk_prepare_enable(sspi->clk);
 	sspi->ctrl_freq = clk_get_rate(sspi->clk);
@@ -594,8 +587,6 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 free_clk:
 	clk_disable_unprepare(sspi->clk);
 	clk_put(sspi->clk);
-free_pin:
-	pinctrl_put(sspi->p);
 free_master:
 	spi_master_put(master);
 err_cs:
@@ -618,7 +609,6 @@ static int  spi_sirfsoc_remove(struct platform_device *pdev)
 	}
 	clk_disable_unprepare(sspi->clk);
 	clk_put(sspi->clk);
-	pinctrl_put(sspi->p);
 	spi_master_put(master);
 	return 0;
 }
Signature · 9 lines
1.7.10.4


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may

A message that is not in the archive (sent off-list or not yet received): 1367868678-12492-1-git-send-email-broonie-yzvPICuk2AATkU/[email protected]

Acked-by
#2 lore raw

2013/5/7 Mark Brown <broonie-yzvPICuk2AATkU/[email protected]>:

Quoted 5 lines

Since commit ab78029 (drivers/pinctrl: grab default handles from device core) we can rely on device core for handling pinctrl so remove devm_pinctrl_get_select_default() from the driver.

Quoted 59 lines
---
 drivers/spi/spi-sirf.c |   12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
drivers/spi/spi-sirf.c +1 -12
index f59d417..899dc3b 100644
@@ -19,7 +19,6 @@
 #include <linux/of_gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
-#include <linux/pinctrl/consumer.h>
 
 #define DRIVER_NAME "sirfsoc_spi"
 
@@ -127,7 +126,6 @@ struct sirfsoc_spi {
        void __iomem *base;
        u32 ctrl_freq;  /* SPI controller clock speed */
        struct clk *clk;
-       struct pinctrl *p;
 
        /* rx & tx bufs from the spi_transfer */
        const void *tx;
@@ -558,15 +556,10 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
        master->bus_num = pdev->id;
        sspi->bitbang.master->dev.of_node = pdev->dev.of_node;
 
-       sspi->p = pinctrl_get_select_default(&pdev->dev);
-       ret = IS_ERR(sspi->p);
-       if (ret)
-               goto free_master;
-
        sspi->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(sspi->clk)) {
                ret = -EINVAL;
-               goto free_pin;
+               goto free_master;
        }
        clk_prepare_enable(sspi->clk);
        sspi->ctrl_freq = clk_get_rate(sspi->clk);
@@ -594,8 +587,6 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 free_clk:
        clk_disable_unprepare(sspi->clk);
        clk_put(sspi->clk);
-free_pin:
-       pinctrl_put(sspi->p);
 free_master:
        spi_master_put(master);
 err_cs:
@@ -618,7 +609,6 @@ static int  spi_sirfsoc_remove(struct platform_device *pdev)
        }
        clk_disable_unprepare(sspi->clk);
        clk_put(sspi->clk);
-       pinctrl_put(sspi->p);
        spi_master_put(master);
        return 0;
 }
--
Quoted 1 line

1.7.10.4

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may