diff mbox series

[2/4] net: mdio: Supply appropriate devices for dev_dgb calls

Message ID 20200913002821.404022-3-seanga2@gmail.com
State Superseded
Delegated to: Tom Rini
Headers show
Series dm: Print device name in dev_xxx() like Linux | expand

Commit Message

Sean Anderson Sept. 13, 2020, 12:28 a.m. UTC
The name of the device we are working on is `ethdev` and not just `dev`.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

 net/mdio-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Sept. 17, 2020, 1:09 a.m. UTC | #1
On Sat, 12 Sep 2020 at 18:28, Sean Anderson <seanga2@gmail.com> wrote:
>
> The name of the device we are working on is `ethdev` and not just `dev`.
>
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
>
>  net/mdio-uclass.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

BTW I really like using 'dev' for the struct udevice if there is only
one, and other names for other things (e.g. edev for Ethernet, udev
for USB).
Sean Anderson Sept. 17, 2020, 1:40 a.m. UTC | #2
On 9/16/20 9:09 PM, Simon Glass wrote:
> On Sat, 12 Sep 2020 at 18:28, Sean Anderson <seanga2@gmail.com> wrote:
>>
>> The name of the device we are working on is `ethdev` and not just `dev`.
>>
>> Signed-off-by: Sean Anderson <seanga2@gmail.com>
>> ---
>>
>>  net/mdio-uclass.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> BTW I really like using 'dev' for the struct udevice if there is only
> one, and other names for other things (e.g. edev for Ethernet, udev
> for USB).
> 

Yeah, I think it is only really necessary when disambiguating between
several different devices. However, I am trying to make these patches as
minimal as possible, so I would like to keep the variable names the same
where possible.

--Sean
Simon Glass Sept. 17, 2020, 3:44 a.m. UTC | #3
Hi Sean,

On Wed, 16 Sep 2020 at 19:40, Sean Anderson <seanga2@gmail.com> wrote:
>
>
> On 9/16/20 9:09 PM, Simon Glass wrote:
> > On Sat, 12 Sep 2020 at 18:28, Sean Anderson <seanga2@gmail.com> wrote:
> >>
> >> The name of the device we are working on is `ethdev` and not just `dev`.
> >>
> >> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> >> ---
> >>
> >>  net/mdio-uclass.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > BTW I really like using 'dev' for the struct udevice if there is only
> > one, and other names for other things (e.g. edev for Ethernet, udev
> > for USB).
> >
>
> Yeah, I think it is only really necessary when disambiguating between
> several different devices. However, I am trying to make these patches as
> minimal as possible, so I would like to keep the variable names the same
> where possible.

Yes definitely better the way you have the patches now.
diff mbox series

Patch

diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c
index 66ee2e1976..b5e8e46512 100644
--- a/net/mdio-uclass.c
+++ b/net/mdio-uclass.c
@@ -145,7 +145,7 @@  static struct phy_device *dm_eth_connect_phy_handle(struct udevice *ethdev,
 			break;
 
 	if (!ofnode_valid(phandle.node)) {
-		dev_dbg(dev, "can't find PHY node\n");
+		dev_dbg(ethdev, "can't find PHY node\n");
 		return NULL;
 	}
 
@@ -161,7 +161,7 @@  static struct phy_device *dm_eth_connect_phy_handle(struct udevice *ethdev,
 	if (uclass_get_device_by_ofnode(UCLASS_MDIO,
 					ofnode_get_parent(phandle.node),
 					&mdiodev)) {
-		dev_dbg(dev, "can't find MDIO bus for node %s\n",
+		dev_dbg(ethdev, "can't find MDIO bus for node %s\n",
 			ofnode_get_name(ofnode_get_parent(phandle.node)));
 		return NULL;
 	}