# Re: \[PATCH net-next 1/2\] net: use dev-\>name in netdev\_pr\* when it's available

- From: Tom Gundersen \<hidden\>
- Date: 2014-07-17 13:49:06 
- List: netdev
- Page: https://ratatoskr.run/netdev/2014/07/10960658
- Thread: https://ratatoskr.run/netdev/2014/07/10960646/t.md

```text
On Thu, Jul 17, 2014 at 1:28 PM, Veaceslav Falico [ref] wrote:
> e() returns dev->name only when the net_device is in
> NETREG_REGISTERED state.
>
> However, dev->name is always populated on creation, so we can easily use
> it. The only caveat is that the device still has a name of type "eth%d", in
> which case we cannot use this name as it'll change in the nearest future,
> thus return "unnamed net_device".

There are also cases when the name is set to emptystring before being
populated with the real name later on. You may want to check for that
too.

Cheers,

Tom
```
