public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap
@ 2012-11-12  6:45 Axel Lin
  2012-11-12  6:46 ` [PATCH 2/2] pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info Axel Lin
  2012-11-13 14:33 ` [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap Linus Walleij
  0 siblings, 2 replies; 7+ messages in thread
From: Axel Lin @ 2012-11-12  6:45 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Haojian Zhuang, linux-kernel

Use managed resources API to simplify the code.
Also ensure we do request mem_region before ioremap.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pinctrl/pinctrl-pxa3xx.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-pxa3xx.c b/drivers/pinctrl/pinctrl-pxa3xx.c
index f14cd6b..43e3dd0 100644
--- a/drivers/pinctrl/pinctrl-pxa3xx.c
+++ b/drivers/pinctrl/pinctrl-pxa3xx.c
@@ -173,7 +173,6 @@ int pxa3xx_pinctrl_register(struct platform_device *pdev,
 {
 	struct pinctrl_desc *desc;
 	struct resource *res;
-	int ret = 0;
 
 	if (!info || !info->cputype)
 		return -EINVAL;
@@ -190,21 +189,17 @@ int pxa3xx_pinctrl_register(struct platform_device *pdev,
 		return -ENOENT;
 	info->phy_base = res->start;
 	info->phy_size = resource_size(res);
-	info->virt_base = ioremap(info->phy_base, info->phy_size);
+	info->virt_base = devm_request_and_ioremap(&pdev->dev, res);
 	if (!info->virt_base)
 		return -ENOMEM;
 	info->pctrl = pinctrl_register(desc, &pdev->dev, info);
 	if (!info->pctrl) {
 		dev_err(&pdev->dev, "failed to register PXA pinmux driver\n");
-		ret = -EINVAL;
-		goto err;
+		return -EINVAL;
 	}
 	pinctrl_add_gpio_range(info->pctrl, &pxa3xx_pinctrl_gpio_range);
 	platform_set_drvdata(pdev, info);
 	return 0;
-err:
-	iounmap(info->virt_base);
-	return ret;
 }
 
 int pxa3xx_pinctrl_unregister(struct platform_device *pdev)
@@ -212,7 +207,6 @@ int pxa3xx_pinctrl_unregister(struct platform_device *pdev)
 	struct pxa3xx_pinmux_info *info = platform_get_drvdata(pdev);
 
 	pinctrl_unregister(info->pctrl);
-	iounmap(info->virt_base);
 	platform_set_drvdata(pdev, NULL);
 	return 0;
 }
-- 
1.7.9.5




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

* [PATCH 2/2] pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info
  2012-11-12  6:45 [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap Axel Lin
@ 2012-11-12  6:46 ` Axel Lin
  2012-11-13 14:34   ` Linus Walleij
  2012-11-13 14:33 ` [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap Linus Walleij
  1 sibling, 1 reply; 7+ messages in thread
From: Axel Lin @ 2012-11-12  6:46 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Haojian Zhuang, linux-kernel

They are not used, remove them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/pinctrl/pinctrl-pxa3xx.c |    2 --
 drivers/pinctrl/pinctrl-pxa3xx.h |    2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-pxa3xx.c b/drivers/pinctrl/pinctrl-pxa3xx.c
index 43e3dd0..51f8a38 100644
--- a/drivers/pinctrl/pinctrl-pxa3xx.c
+++ b/drivers/pinctrl/pinctrl-pxa3xx.c
@@ -187,8 +187,6 @@ int pxa3xx_pinctrl_register(struct platform_device *pdev,
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res)
 		return -ENOENT;
-	info->phy_base = res->start;
-	info->phy_size = resource_size(res);
 	info->virt_base = devm_request_and_ioremap(&pdev->dev, res);
 	if (!info->virt_base)
 		return -ENOMEM;
diff --git a/drivers/pinctrl/pinctrl-pxa3xx.h b/drivers/pinctrl/pinctrl-pxa3xx.h
index 8135744..92fad08 100644
--- a/drivers/pinctrl/pinctrl-pxa3xx.h
+++ b/drivers/pinctrl/pinctrl-pxa3xx.h
@@ -60,8 +60,6 @@ struct pxa3xx_pinmux_info {
 	struct device *dev;
 	struct pinctrl_dev *pctrl;
 	enum pxa_cpu_type cputype;
-	unsigned int phy_base;
-	unsigned int phy_size;
 	void __iomem *virt_base;
 
 	struct pxa3xx_mfp_pin *mfp;
-- 
1.7.9.5




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

* Re: [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap
  2012-11-12  6:45 [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap Axel Lin
  2012-11-12  6:46 ` [PATCH 2/2] pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info Axel Lin
@ 2012-11-13 14:33 ` Linus Walleij
  2012-11-14  1:47   ` Haojian Zhuang
  1 sibling, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-11-13 14:33 UTC (permalink / raw)
  To: Axel Lin; +Cc: Haojian Zhuang, linux-kernel

On Mon, Nov 12, 2012 at 7:45 AM, Axel Lin <axel.lin@ingics.com> wrote:

> Use managed resources API to simplify the code.
> Also ensure we do request mem_region before ioremap.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Obviously correct, patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 2/2] pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info
  2012-11-12  6:46 ` [PATCH 2/2] pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info Axel Lin
@ 2012-11-13 14:34   ` Linus Walleij
  0 siblings, 0 replies; 7+ messages in thread
From: Linus Walleij @ 2012-11-13 14:34 UTC (permalink / raw)
  To: Axel Lin; +Cc: Haojian Zhuang, linux-kernel

On Mon, Nov 12, 2012 at 7:46 AM, Axel Lin <axel.lin@ingics.com> wrote:

> They are not used, remove them.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied, thanks!
Linus Walleij

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

* Re: [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap
  2012-11-13 14:33 ` [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap Linus Walleij
@ 2012-11-14  1:47   ` Haojian Zhuang
  2012-11-15 11:19     ` Linus Walleij
  0 siblings, 1 reply; 7+ messages in thread
From: Haojian Zhuang @ 2012-11-14  1:47 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Axel Lin, linux-kernel@vger.kernel.org

On Tue, Nov 13, 2012 at 10:33 PM, Linus Walleij
<linus.walleij@linaro.org> wrote:
> On Mon, Nov 12, 2012 at 7:45 AM, Axel Lin <axel.lin@ingics.com> wrote:
>
>> Use managed resources API to simplify the code.
>> Also ensure we do request mem_region before ioremap.
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>
> Obviously correct, patch applied.
>
> Yours,
> Linus Walleij

If the patches on pinctrl-single driver are merged, it will be used as
pinctrl driver for PXA/MMP.
And this pinctrl-pxa3xx driver would be deleted. So it's not recommend
to update code on this
driver.

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

* Re: [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap
  2012-11-14  1:47   ` Haojian Zhuang
@ 2012-11-15 11:19     ` Linus Walleij
  2012-11-15 11:24       ` Haojian Zhuang
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2012-11-15 11:19 UTC (permalink / raw)
  To: Haojian Zhuang; +Cc: Axel Lin, linux-kernel@vger.kernel.org

On Wed, Nov 14, 2012 at 2:47 AM, Haojian Zhuang
<haojian.zhuang@gmail.com> wrote:
> On Tue, Nov 13, 2012 at 10:33 PM, Linus Walleij
> <linus.walleij@linaro.org> wrote:
>> On Mon, Nov 12, 2012 at 7:45 AM, Axel Lin <axel.lin@ingics.com> wrote:
>>
>>> Use managed resources API to simplify the code.
>>> Also ensure we do request mem_region before ioremap.
>>>
>>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>>
>> Obviously correct, patch applied.
>>
>> Yours,
>> Linus Walleij
>
> If the patches on pinctrl-single driver are merged, it will be used as
> pinctrl driver for PXA/MMP.
> And this pinctrl-pxa3xx driver would be deleted. So it's not recommend
> to update code on this
> driver.

I'll take care if it if there is a conflict, it will all be in the pinctrl
tree anyway right?

Yours,
Linus Walleij

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

* Re: [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap
  2012-11-15 11:19     ` Linus Walleij
@ 2012-11-15 11:24       ` Haojian Zhuang
  0 siblings, 0 replies; 7+ messages in thread
From: Haojian Zhuang @ 2012-11-15 11:24 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Axel Lin, linux-kernel@vger.kernel.org

On Thu, Nov 15, 2012 at 7:19 PM, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Nov 14, 2012 at 2:47 AM, Haojian Zhuang
> <haojian.zhuang@gmail.com> wrote:
>> On Tue, Nov 13, 2012 at 10:33 PM, Linus Walleij
>> <linus.walleij@linaro.org> wrote:
>>> On Mon, Nov 12, 2012 at 7:45 AM, Axel Lin <axel.lin@ingics.com> wrote:
>>>
>>>> Use managed resources API to simplify the code.
>>>> Also ensure we do request mem_region before ioremap.
>>>>
>>>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>>>
>>> Obviously correct, patch applied.
>>>
>>> Yours,
>>> Linus Walleij
>>
>> If the patches on pinctrl-single driver are merged, it will be used as
>> pinctrl driver for PXA/MMP.
>> And this pinctrl-pxa3xx driver would be deleted. So it's not recommend
>> to update code on this
>> driver.
>
> I'll take care if it if there is a conflict, it will all be in the pinctrl
> tree anyway right?
>
> Yours,
> Linus Walleij

Thanks.

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

end of thread, other threads:[~2012-11-15 11:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-12  6:45 [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap Axel Lin
2012-11-12  6:46 ` [PATCH 2/2] pinctrl: pxa3xx: Remove phy_base and phy_size from struct pxa3xx_pinmux_info Axel Lin
2012-11-13 14:34   ` Linus Walleij
2012-11-13 14:33 ` [PATCH 1/2] pinctrl: pxa3xx: Use devm_request_and_ioremap Linus Walleij
2012-11-14  1:47   ` Haojian Zhuang
2012-11-15 11:19     ` Linus Walleij
2012-11-15 11:24       ` Haojian Zhuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox