All of lore.kernel.org
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 10/10] net/macb: add pinctrl consumer support
Date: Wed, 31 Oct 2012 11:42:14 +0100	[thread overview]
Message-ID: <50910086.6080705@atmel.com> (raw)
In-Reply-To: <CAGhQ9VxJ58ej3j9eEx1rex5h-ua_C53=Z4WwGk5YdjfaYTdHpw@mail.gmail.com>

On 10/30/2012 06:37 PM, Joachim Eastwood :
> On 30 October 2012 11:18, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>> From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>>
>> If no pinctrl available just report a warning as some architecture may not
>> need to do anything.
>>
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> [nicolas.ferre at atmel.com: adapt the error path]
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> Cc: netdev at vger.kernel.org
>> ---
>>  drivers/net/ethernet/cadence/macb.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
>> index 4d51877..eae3d74 100644
>> --- a/drivers/net/ethernet/cadence/macb.c
>> +++ b/drivers/net/ethernet/cadence/macb.c
>> @@ -26,6 +26,9 @@
>>  #include <linux/of.h>
>>  #include <linux/of_device.h>
>>  #include <linux/of_net.h>
>> +#include <linux/of_gpio.h>
>> +#include <linux/gpio.h>
> Why are these two headers added?
> I don't see anything from them used in the code added.
> 
> Wouldn't the pinctrl header by itself be sufficient?

It is: I will remove the two unneeded headers in my v4 patch series.

Thanks,

> 
>> +#include <linux/pinctrl/consumer.h>
>>
>>  #include "macb.h"
>>
>> @@ -1472,6 +1475,7 @@ static int __init macb_probe(struct platform_device *pdev)
>>         struct phy_device *phydev;
>>         u32 config;
>>         int err = -ENXIO;
>> +       struct pinctrl *pinctrl;
>>
>>         regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>         if (!regs) {
>> @@ -1479,6 +1483,15 @@ static int __init macb_probe(struct platform_device *pdev)
>>                 goto err_out;
>>         }
>>
>> +       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>> +       if (IS_ERR(pinctrl)) {
>> +               err = PTR_ERR(pinctrl);
>> +               if (err == -EPROBE_DEFER)
>> +                       goto err_out;
>> +
>> +               dev_warn(&pdev->dev, "No pinctrl provided\n");
>> +       }
>> +
>>         err = -ENOMEM;
>>         dev = alloc_etherdev(sizeof(*bp));
>>         if (!dev)

Best regards,
-- 
Nicolas Ferre

WARNING: multiple messages have this Message-ID (diff)
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Joachim Eastwood <manabian@gmail.com>
Cc: <netdev@vger.kernel.org>, <davem@davemloft.net>,
	<havard@skinnemoen.net>, <bhutchings@solarflare.com>,
	<linux-arm-kernel@lists.infradead.org>, <plagnioj@jcrosoft.com>,
	<patrice.vilchez@atmel.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 10/10] net/macb: add pinctrl consumer support
Date: Wed, 31 Oct 2012 11:42:14 +0100	[thread overview]
Message-ID: <50910086.6080705@atmel.com> (raw)
In-Reply-To: <CAGhQ9VxJ58ej3j9eEx1rex5h-ua_C53=Z4WwGk5YdjfaYTdHpw@mail.gmail.com>

On 10/30/2012 06:37 PM, Joachim Eastwood :
> On 30 October 2012 11:18, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>> From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>>
>> If no pinctrl available just report a warning as some architecture may not
>> need to do anything.
>>
>> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>> [nicolas.ferre@atmel.com: adapt the error path]
>> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
>> Cc: netdev@vger.kernel.org
>> ---
>>  drivers/net/ethernet/cadence/macb.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
>> index 4d51877..eae3d74 100644
>> --- a/drivers/net/ethernet/cadence/macb.c
>> +++ b/drivers/net/ethernet/cadence/macb.c
>> @@ -26,6 +26,9 @@
>>  #include <linux/of.h>
>>  #include <linux/of_device.h>
>>  #include <linux/of_net.h>
>> +#include <linux/of_gpio.h>
>> +#include <linux/gpio.h>
> Why are these two headers added?
> I don't see anything from them used in the code added.
> 
> Wouldn't the pinctrl header by itself be sufficient?

It is: I will remove the two unneeded headers in my v4 patch series.

Thanks,

> 
>> +#include <linux/pinctrl/consumer.h>
>>
>>  #include "macb.h"
>>
>> @@ -1472,6 +1475,7 @@ static int __init macb_probe(struct platform_device *pdev)
>>         struct phy_device *phydev;
>>         u32 config;
>>         int err = -ENXIO;
>> +       struct pinctrl *pinctrl;
>>
>>         regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>         if (!regs) {
>> @@ -1479,6 +1483,15 @@ static int __init macb_probe(struct platform_device *pdev)
>>                 goto err_out;
>>         }
>>
>> +       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
>> +       if (IS_ERR(pinctrl)) {
>> +               err = PTR_ERR(pinctrl);
>> +               if (err == -EPROBE_DEFER)
>> +                       goto err_out;
>> +
>> +               dev_warn(&pdev->dev, "No pinctrl provided\n");
>> +       }
>> +
>>         err = -ENOMEM;
>>         dev = alloc_etherdev(sizeof(*bp));
>>         if (!dev)

Best regards,
-- 
Nicolas Ferre

  reply	other threads:[~2012-10-31 10:42 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 10:17 [PATCH v3 00/10] net/macb: driver enhancement concerning GEM support, ring logic and cleanup Nicolas Ferre
2012-10-30 10:17 ` Nicolas Ferre
2012-10-30 10:17 ` [PATCH v3 01/10] net/macb: Add support for Gigabit Ethernet mode Nicolas Ferre
2012-10-30 10:17   ` Nicolas Ferre
2012-10-30 10:17 ` [PATCH v3 02/10] net/macb: memory barriers cleanup Nicolas Ferre
2012-10-30 10:17   ` Nicolas Ferre
2012-10-30 10:17 ` [PATCH v3 03/10] net/macb: change debugging messages Nicolas Ferre
2012-10-30 10:17   ` Nicolas Ferre
2012-10-30 10:17 ` [PATCH v3 04/10] net/macb: remove macb_get_drvinfo() Nicolas Ferre
2012-10-30 10:17   ` Nicolas Ferre
2012-10-30 10:17 ` [PATCH v3 05/10] net/macb: tx status is more than 8 bits now Nicolas Ferre
2012-10-30 10:17   ` Nicolas Ferre
2012-10-30 10:17 ` [PATCH v3 06/10] net/macb: clean up ring buffer logic Nicolas Ferre
2012-10-30 10:17   ` Nicolas Ferre
2012-10-30 11:12   ` David Laight
2012-10-30 11:12     ` David Laight
2012-10-30 18:22     ` Håvard Skinnemoen
2012-10-30 18:22       ` Håvard Skinnemoen
2012-10-31  8:57       ` David Laight
2012-10-31  8:57         ` David Laight
2012-10-31  9:59       ` Nicolas Ferre
2012-10-31  9:59         ` Nicolas Ferre
2012-10-31 10:39         ` Nicolas Ferre
2012-10-31 10:39           ` Nicolas Ferre
2012-10-31  9:48           ` David Laight
2012-10-31  9:48             ` David Laight
2012-10-30 11:30   ` [PATCH] net/at91_ether: fix the use of macb structure Nicolas Ferre
2012-10-30 11:30     ` Nicolas Ferre
2012-11-03 19:04     ` David Miller
2012-11-03 19:04       ` David Miller
2012-11-04 23:02       ` Nicolas Ferre
2012-11-04 23:02         ` Nicolas Ferre
2012-10-30 10:17 ` [PATCH v3 07/10] net/macb: ethtool interface: add register dump feature Nicolas Ferre
2012-10-30 10:17   ` Nicolas Ferre
2012-10-30 10:18 ` [PATCH v3 08/10] net/macb: better manage tx errors Nicolas Ferre
2012-10-30 10:18   ` Nicolas Ferre
2012-10-30 10:18 ` [PATCH v3 09/10] net/macb: Offset first RX buffer by two bytes Nicolas Ferre
2012-10-30 10:18   ` Nicolas Ferre
2012-10-30 10:18 ` [PATCH v3 10/10] net/macb: add pinctrl consumer support Nicolas Ferre
2012-10-30 10:18   ` Nicolas Ferre
2012-10-30 17:37   ` Joachim Eastwood
2012-10-30 17:37     ` Joachim Eastwood
2012-10-31 10:42     ` Nicolas Ferre [this message]
2012-10-31 10:42       ` Nicolas Ferre
2012-10-30 11:26 ` [PATCH v3 00/10] net/macb: driver enhancement concerning GEM support, ring logic and cleanup Nicolas Ferre
2012-10-30 11:26   ` Nicolas Ferre
2012-10-30 17:31 ` Joachim Eastwood
2012-10-30 17:31   ` Joachim Eastwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50910086.6080705@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.