Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-27 Thread Sergei Shtylyov

On 27-07-2013 12:58, Prashant Shah wrote:


It's also called managed device API. In fact, I've never heard it
named devres API.



If I understood it correctly it has to just calls
devm_request_region() with the struct device pointer and there are no
deallocation functions to call ? It manages deallocation on it own.


   Yes.


Regards.


WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-27 Thread Prashant Shah
Hi,

On Fri, Jul 26, 2013 at 12:08 AM, Aaro Koskinen  wrote:
> Hi,
>
> On Thu, Jul 25, 2013 at 10:33:24PM +0400, Sergei Shtylyov wrote:
>>It's also called managed device API. In fact, I've never heard it
>> named devres API.

If I understood it correctly it has to just calls
devm_request_region() with the struct device pointer and there are no
deallocation functions to call ? It manages deallocation on it own.

Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-27 Thread Prashant Shah
Hi,

On Fri, Jul 26, 2013 at 12:08 AM, Aaro Koskinen aaro.koski...@iki.fi wrote:
 Hi,

 On Thu, Jul 25, 2013 at 10:33:24PM +0400, Sergei Shtylyov wrote:
It's also called managed device API. In fact, I've never heard it
 named devres API.

If I understood it correctly it has to just calls
devm_request_region() with the struct device pointer and there are no
deallocation functions to call ? It manages deallocation on it own.

Regards.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-27 Thread Sergei Shtylyov

On 27-07-2013 12:58, Prashant Shah wrote:


It's also called managed device API. In fact, I've never heard it
named devres API.



If I understood it correctly it has to just calls
devm_request_region() with the struct device pointer and there are no
deallocation functions to call ? It manages deallocation on it own.


   Yes.


Regards.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-25 Thread Aaro Koskinen
Hi,

On Thu, Jul 25, 2013 at 10:33:24PM +0400, Sergei Shtylyov wrote:
>It's also called managed device API. In fact, I've never heard it
> named devres API.

Never read the documentation. :-)

$ head -1 Documentation/driver-model/devres.txt 
Devres - Managed Device Resource

A.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-25 Thread Sergei Shtylyov

Hello.

On 07/25/2013 10:31 PM, Andy Shevchenko wrote:


Andy,
   I can't find a single example of a devres_* call in
drivers/net/ethernet/*. Does any networking code exist that we can look at
as an example for conversion to the devres API?



devres API usually means managed version of the functions that used
mostly at probe() stage.
For example, devm_*() or pcim_*() calls.


   It's also called managed device API. In fact, I've never heard it named 
devres API.


WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-25 Thread Andy Shevchenko
On Thu, Jul 25, 2013 at 6:20 PM, tedheadster  wrote:
> Andy,
>   I can't find a single example of a devres_* call in
> drivers/net/ethernet/*. Does any networking code exist that we can look at
> as an example for conversion to the devres API?

devres API usually means managed version of the functions that used
mostly at probe() stage.
For example, devm_*() or pcim_*() calls.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-25 Thread Andy Shevchenko
On Thu, Jul 25, 2013 at 8:38 AM, Prashant Shah  wrote:
> On Thu, Jul 25, 2013 at 10:49 AM, Prashant Shah  
> wrote:
>>> You should also remove the definition of DRV_NAME, since it is no longer
>>> used. The changelog should probably mention that this will change the
>>> interrupt name (which appears in /proc/interrupts for example) from "wd"
>>> to "eth%d".
>
> I was going through the code. The apne driver apne.c in the same
> folder is using DRV_NAME in request_region()
>
>> if (!request_region(IOBASE, 0x20, DRV_NAME)) {
>
> I can change the wd.c request_region() code to use DRV_NAME. Currently
> it is using a string constant.
>
>> r = request_region(base_addr, WD_IO_EXTENT, "wd-probe");
>
> This will make it more consistent. Please suggest which change is more
> preferable.

If you convert each driver to use devres API, you may avoid a lot of
useless work.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-25 Thread Andy Shevchenko
On Thu, Jul 25, 2013 at 8:38 AM, Prashant Shah pshah.mum...@gmail.com wrote:
 On Thu, Jul 25, 2013 at 10:49 AM, Prashant Shah pshah.mum...@gmail.com 
 wrote:
 You should also remove the definition of DRV_NAME, since it is no longer
 used. The changelog should probably mention that this will change the
 interrupt name (which appears in /proc/interrupts for example) from wd
 to eth%d.

 I was going through the code. The apne driver apne.c in the same
 folder is using DRV_NAME in request_region()

 if (!request_region(IOBASE, 0x20, DRV_NAME)) {

 I can change the wd.c request_region() code to use DRV_NAME. Currently
 it is using a string constant.

 r = request_region(base_addr, WD_IO_EXTENT, wd-probe);

 This will make it more consistent. Please suggest which change is more
 preferable.

If you convert each driver to use devres API, you may avoid a lot of
useless work.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-25 Thread Andy Shevchenko
On Thu, Jul 25, 2013 at 6:20 PM, tedheadster tedheads...@gmail.com wrote:
 Andy,
   I can't find a single example of a devres_* call in
 drivers/net/ethernet/*. Does any networking code exist that we can look at
 as an example for conversion to the devres API?

devres API usually means managed version of the functions that used
mostly at probe() stage.
For example, devm_*() or pcim_*() calls.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-25 Thread Sergei Shtylyov

Hello.

On 07/25/2013 10:31 PM, Andy Shevchenko wrote:


Andy,
   I can't find a single example of a devres_* call in
drivers/net/ethernet/*. Does any networking code exist that we can look at
as an example for conversion to the devres API?



devres API usually means managed version of the functions that used
mostly at probe() stage.
For example, devm_*() or pcim_*() calls.


   It's also called managed device API. In fact, I've never heard it named 
devres API.


WBR, Sergei

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-25 Thread Aaro Koskinen
Hi,

On Thu, Jul 25, 2013 at 10:33:24PM +0400, Sergei Shtylyov wrote:
It's also called managed device API. In fact, I've never heard it
 named devres API.

Never read the documentation. :-)

$ head -1 Documentation/driver-model/devres.txt 
Devres - Managed Device Resource

A.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-24 Thread Prashant Shah
Hi,

On Thu, Jul 25, 2013 at 10:49 AM, Prashant Shah  wrote:
> Hi,
>
>> You should also remove the definition of DRV_NAME, since it is no longer
>> used. The changelog should probably mention that this will change the
>> interrupt name (which appears in /proc/interrupts for example) from "wd"
>> to "eth%d".
>>

I was going through the code. The apne driver apne.c in the same
folder is using DRV_NAME in request_region()

> if (!request_region(IOBASE, 0x20, DRV_NAME)) {

I can change the wd.c request_region() code to use DRV_NAME. Currently
it is using a string constant.

> r = request_region(base_addr, WD_IO_EXTENT, "wd-probe");

This will make it more consistent. Please suggest which change is more
preferable.

@Matthew, following drivers are not using dev->name in request_irq()
axnet_cs.c
mac8390.c
hydra.c
ne-h8300.c
apne.c
stnic.c
zorro8390.c

Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-24 Thread Prashant Shah
Hi,

> You should also remove the definition of DRV_NAME, since it is no longer
> used. The changelog should probably mention that this will change the
> interrupt name (which appears in /proc/interrupts for example) from "wd"
> to "eth%d".
>

I will resend the patch.

Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-24 Thread Ryan Mallon
On 24/07/13 16:09, Prashant Shah wrote:
> Signed-off-by: Prashant Shah 
> ---
>  drivers/net/ethernet/8390/wd.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
> index 03eb3ee..b43a63f 100644
> --- a/drivers/net/ethernet/8390/wd.c
> +++ b/drivers/net/ethernet/8390/wd.c
> @@ -308,7 +308,7 @@ static int __init wd_probe1(struct net_device *dev, int 
> ioaddr)
>  
>   /* Snarf the interrupt now.  There's no point in waiting since we cannot
>  share and the board will usually be enabled. */
> - i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
> + i = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);

You should also remove the definition of DRV_NAME, since it is no longer
used. The changelog should probably mention that this will change the
interrupt name (which appears in /proc/interrupts for example) from "wd"
to "eth%d".

~Ryan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Change request_irq() to use struct net_device *dev->name

2013-07-24 Thread Prashant Shah
Signed-off-by: Prashant Shah 
---
 drivers/net/ethernet/8390/wd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
index 03eb3ee..b43a63f 100644
--- a/drivers/net/ethernet/8390/wd.c
+++ b/drivers/net/ethernet/8390/wd.c
@@ -308,7 +308,7 @@ static int __init wd_probe1(struct net_device *dev, int 
ioaddr)
 
/* Snarf the interrupt now.  There's no point in waiting since we cannot
   share and the board will usually be enabled. */
-   i = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev);
+   i = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev);
if (i) {
printk (" unable to get IRQ %d.\n", dev->irq);
return i;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-24 Thread Ryan Mallon
On 24/07/13 16:09, Prashant Shah wrote:
 Signed-off-by: Prashant Shah pshah.mum...@gmail.com
 ---
  drivers/net/ethernet/8390/wd.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
 index 03eb3ee..b43a63f 100644
 --- a/drivers/net/ethernet/8390/wd.c
 +++ b/drivers/net/ethernet/8390/wd.c
 @@ -308,7 +308,7 @@ static int __init wd_probe1(struct net_device *dev, int 
 ioaddr)
  
   /* Snarf the interrupt now.  There's no point in waiting since we cannot
  share and the board will usually be enabled. */
 - i = request_irq(dev-irq, ei_interrupt, 0, DRV_NAME, dev);
 + i = request_irq(dev-irq, ei_interrupt, 0, dev-name, dev);

You should also remove the definition of DRV_NAME, since it is no longer
used. The changelog should probably mention that this will change the
interrupt name (which appears in /proc/interrupts for example) from wd
to eth%d.

~Ryan

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-24 Thread Prashant Shah
Hi,

 You should also remove the definition of DRV_NAME, since it is no longer
 used. The changelog should probably mention that this will change the
 interrupt name (which appears in /proc/interrupts for example) from wd
 to eth%d.


I will resend the patch.

Regards.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-24 Thread Prashant Shah
Hi,

On Thu, Jul 25, 2013 at 10:49 AM, Prashant Shah pshah.mum...@gmail.com wrote:
 Hi,

 You should also remove the definition of DRV_NAME, since it is no longer
 used. The changelog should probably mention that this will change the
 interrupt name (which appears in /proc/interrupts for example) from wd
 to eth%d.


I was going through the code. The apne driver apne.c in the same
folder is using DRV_NAME in request_region()

 if (!request_region(IOBASE, 0x20, DRV_NAME)) {

I can change the wd.c request_region() code to use DRV_NAME. Currently
it is using a string constant.

 r = request_region(base_addr, WD_IO_EXTENT, wd-probe);

This will make it more consistent. Please suggest which change is more
preferable.

@Matthew, following drivers are not using dev-name in request_irq()
axnet_cs.c
mac8390.c
hydra.c
ne-h8300.c
apne.c
stnic.c
zorro8390.c

Regards.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Change request_irq() to use struct net_device *dev-name

2013-07-24 Thread Prashant Shah
Signed-off-by: Prashant Shah pshah.mum...@gmail.com
---
 drivers/net/ethernet/8390/wd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/8390/wd.c b/drivers/net/ethernet/8390/wd.c
index 03eb3ee..b43a63f 100644
--- a/drivers/net/ethernet/8390/wd.c
+++ b/drivers/net/ethernet/8390/wd.c
@@ -308,7 +308,7 @@ static int __init wd_probe1(struct net_device *dev, int 
ioaddr)
 
/* Snarf the interrupt now.  There's no point in waiting since we cannot
   share and the board will usually be enabled. */
-   i = request_irq(dev-irq, ei_interrupt, 0, DRV_NAME, dev);
+   i = request_irq(dev-irq, ei_interrupt, 0, dev-name, dev);
if (i) {
printk ( unable to get IRQ %d.\n, dev-irq);
return i;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/