* [PATCH V2 4/6] NET: MIPS: lantiq: convert etop to managed gpio
[not found] <1330012913-13293-1-git-send-email-blogic@openwrt.org>
@ 2012-02-23 16:01 ` John Crispin
2012-02-24 10:36 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: John Crispin @ 2012-02-23 16:01 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, John Crispin, netdev
ltq_gpio_request() now uses devres to manage the gpios. We need to pass a
struct device pointer to make it work.
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: netdev@vger.kernel.org
---
drivers/net/ethernet/lantiq_etop.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 66ec54a..e5ec8b1 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -292,9 +292,6 @@ ltq_etop_gbit_init(void)
{
ltq_pmu_enable(PMU_SWITCH);
- ltq_gpio_request(42, 2, 1, "MDIO");
- ltq_gpio_request(43, 2, 1, "MDC");
-
ltq_gbit_w32_mask(0, GCTL0_SE, LTQ_GBIT_GCTL0);
/** Disable MDIO auto polling mode */
ltq_gbit_w32_mask(0, PX_CTL_DMDIO, LTQ_GBIT_P0_CTL);
@@ -873,6 +870,12 @@ ltq_etop_probe(struct platform_device *pdev)
err = -ENOMEM;
goto err_out;
}
+ if (ltq_gpio_request(&pdev->dev, 42, 2, 1, "MDIO") ||
+ ltq_gpio_request(&pdev->dev, 43, 2, 1, "MDC")) {
+ dev_err(&pdev->dev, "failed to request MDIO gpios\n");
+ err = -EBUSY;
+ goto err_out;
+ }
}
dev = alloc_etherdev_mq(sizeof(struct ltq_etop_priv), 4);
--
1.7.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V2 4/6] NET: MIPS: lantiq: convert etop to managed gpio
2012-02-23 16:01 ` [PATCH V2 4/6] NET: MIPS: lantiq: convert etop to managed gpio John Crispin
@ 2012-02-24 10:36 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2012-02-24 10:36 UTC (permalink / raw)
To: John Crispin; +Cc: Ralf Baechle, linux-mips, netdev
Hello.
On 23-02-2012 20:01, John Crispin wrote:
> ltq_gpio_request() now uses devres to manage the gpios. We need to pass a
> struct device pointer to make it work.
> Signed-off-by: John Crispin<blogic@openwrt.org>
> Cc: netdev@vger.kernel.org
> ---
> drivers/net/ethernet/lantiq_etop.c | 9 ++++++---
> 1 files changed, 6 insertions(+), 3 deletions(-)
> diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
> index 66ec54a..e5ec8b1 100644
> --- a/drivers/net/ethernet/lantiq_etop.c
> +++ b/drivers/net/ethernet/lantiq_etop.c
> @@ -292,9 +292,6 @@ ltq_etop_gbit_init(void)
> {
> ltq_pmu_enable(PMU_SWITCH);
>
> - ltq_gpio_request(42, 2, 1, "MDIO");
> - ltq_gpio_request(43, 2, 1, "MDC");
> -
> ltq_gbit_w32_mask(0, GCTL0_SE, LTQ_GBIT_GCTL0);
> /** Disable MDIO auto polling mode */
> ltq_gbit_w32_mask(0, PX_CTL_DMDIO, LTQ_GBIT_P0_CTL);
> @@ -873,6 +870,12 @@ ltq_etop_probe(struct platform_device *pdev)
> err = -ENOMEM;
> goto err_out;
> }
> + if (ltq_gpio_request(&pdev->dev, 42, 2, 1, "MDIO") ||
> + ltq_gpio_request(&pdev->dev, 43, 2, 1, "MDC")) {
This needs to be merged with patch 1 to keep the git tree bisectable
WBR, Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-24 10:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1330012913-13293-1-git-send-email-blogic@openwrt.org>
2012-02-23 16:01 ` [PATCH V2 4/6] NET: MIPS: lantiq: convert etop to managed gpio John Crispin
2012-02-24 10:36 ` Sergei Shtylyov
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).