netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Change request_irq() to use struct net_device *dev->name
@ 2013-07-24  6:09 Prashant Shah
  2013-07-25  0:42 ` Ryan Mallon
  0 siblings, 1 reply; 11+ messages in thread
From: Prashant Shah @ 2013-07-24  6:09 UTC (permalink / raw)
  To: netdev; +Cc: linux-kernel, kernel-mentors

Signed-off-by: Prashant Shah <pshah.mumbai@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

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-24  6:09 [PATCH] Change request_irq() to use struct net_device *dev->name Prashant Shah
@ 2013-07-25  0:42 ` Ryan Mallon
  2013-07-25  5:19   ` Prashant Shah
  0 siblings, 1 reply; 11+ messages in thread
From: Ryan Mallon @ 2013-07-25  0:42 UTC (permalink / raw)
  To: Prashant Shah; +Cc: netdev, linux-kernel, mwhitehe, kernel-mentors

On 24/07/13 16:09, Prashant Shah wrote:
> Signed-off-by: Prashant Shah <pshah.mumbai@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

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25  0:42 ` Ryan Mallon
@ 2013-07-25  5:19   ` Prashant Shah
  2013-07-25  5:38     ` Prashant Shah
  0 siblings, 1 reply; 11+ messages in thread
From: Prashant Shah @ 2013-07-25  5:19 UTC (permalink / raw)
  To: Ryan Mallon; +Cc: kernel-mentors, netdev, linux-kernel

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.

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25  5:19   ` Prashant Shah
@ 2013-07-25  5:38     ` Prashant Shah
  2013-07-25 12:16       ` Andy Shevchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Prashant Shah @ 2013-07-25  5:38 UTC (permalink / raw)
  To: Ryan Mallon; +Cc: kernel-mentors, netdev, linux-kernel

Hi,

On Thu, Jul 25, 2013 at 10:49 AM, Prashant Shah <pshah.mumbai@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.

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25  5:38     ` Prashant Shah
@ 2013-07-25 12:16       ` Andy Shevchenko
  2013-07-25 15:20         ` tedheadster
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Shevchenko @ 2013-07-25 12:16 UTC (permalink / raw)
  To: Prashant Shah; +Cc: Ryan Mallon, netdev, linux-kernel, mwhitehe, kernel-mentors

On Thu, Jul 25, 2013 at 8:38 AM, Prashant Shah <pshah.mumbai@gmail.com> wrote:
> On Thu, Jul 25, 2013 at 10:49 AM, Prashant Shah <pshah.mumbai@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

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25 12:16       ` Andy Shevchenko
@ 2013-07-25 15:20         ` tedheadster
  2013-07-25 18:31           ` Andy Shevchenko
  0 siblings, 1 reply; 11+ messages in thread
From: tedheadster @ 2013-07-25 15:20 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: kernel-mentors, Ryan Mallon, netdev, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 194 bytes --]

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?

- Matthew

[-- Attachment #1.2: Type: text/html, Size: 261 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
Kernel-mentors mailing list
Kernel-mentors@selenic.com
http://selenic.com/mailman/listinfo/kernel-mentors

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25 15:20         ` tedheadster
@ 2013-07-25 18:31           ` Andy Shevchenko
  2013-07-25 18:33             ` Sergei Shtylyov
  0 siblings, 1 reply; 11+ messages in thread
From: Andy Shevchenko @ 2013-07-25 18:31 UTC (permalink / raw)
  To: whiteheadm
  Cc: Prashant Shah, Ryan Mallon, netdev, linux-kernel, mwhitehe,
	kernel-mentors

On Thu, Jul 25, 2013 at 6:20 PM, tedheadster <tedheadster@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

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25 18:31           ` Andy Shevchenko
@ 2013-07-25 18:33             ` Sergei Shtylyov
  2013-07-25 18:38               ` Aaro Koskinen
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Shtylyov @ 2013-07-25 18:33 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: whiteheadm, Prashant Shah, Ryan Mallon, netdev, linux-kernel,
	mwhitehe, kernel-mentors

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

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25 18:33             ` Sergei Shtylyov
@ 2013-07-25 18:38               ` Aaro Koskinen
  2013-07-27  8:58                 ` Prashant Shah
  0 siblings, 1 reply; 11+ messages in thread
From: Aaro Koskinen @ 2013-07-25 18:38 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Andy Shevchenko, whiteheadm, Prashant Shah, Ryan Mallon, netdev,
	linux-kernel, mwhitehe, kernel-mentors

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.

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-25 18:38               ` Aaro Koskinen
@ 2013-07-27  8:58                 ` Prashant Shah
  2013-07-27 15:13                   ` Sergei Shtylyov
  0 siblings, 1 reply; 11+ messages in thread
From: Prashant Shah @ 2013-07-27  8:58 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: kernel-mentors, Ryan Mallon, Sergei Shtylyov, netdev,
	linux-kernel, Andy Shevchenko, whiteheadm

Hi,

On Fri, Jul 26, 2013 at 12:08 AM, Aaro Koskinen <aaro.koskinen@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.

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

* Re: [PATCH] Change request_irq() to use struct net_device *dev->name
  2013-07-27  8:58                 ` Prashant Shah
@ 2013-07-27 15:13                   ` Sergei Shtylyov
  0 siblings, 0 replies; 11+ messages in thread
From: Sergei Shtylyov @ 2013-07-27 15:13 UTC (permalink / raw)
  To: Prashant Shah
  Cc: kernel-mentors, Ryan Mallon, Aaro Koskinen, netdev, linux-kernel,
	Andy Shevchenko, whiteheadm

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

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

end of thread, other threads:[~2013-07-27 15:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-24  6:09 [PATCH] Change request_irq() to use struct net_device *dev->name Prashant Shah
2013-07-25  0:42 ` Ryan Mallon
2013-07-25  5:19   ` Prashant Shah
2013-07-25  5:38     ` Prashant Shah
2013-07-25 12:16       ` Andy Shevchenko
2013-07-25 15:20         ` tedheadster
2013-07-25 18:31           ` Andy Shevchenko
2013-07-25 18:33             ` Sergei Shtylyov
2013-07-25 18:38               ` Aaro Koskinen
2013-07-27  8:58                 ` Prashant Shah
2013-07-27 15:13                   ` 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).