Re: [PATCH v2] usb: phy: move some error messages to dev_dbg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Mon, Jan 27, 2014 at 11:44:16PM +0300, Sergei Shtylyov wrote:
> >diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
> >index e6f61e4..db18011 100644
> >--- a/drivers/usb/phy/phy.c
> >+++ b/drivers/usb/phy/phy.c
> >@@ -130,7 +130,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type)
> >
> >  	phy = __usb_find_phy(&phy_list, type);
> >  	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
> >-		pr_err("unable to find transceiver of type %s\n",
> >+		dev_dbg(phy->dev, "unable to find transceiver of type %s\n",
> 
>    'phy' is possibly invalid (error ptr) at this point, you cannot
> dereference it.

right, this one can't be a dev_dbg(), unfortunately.

> >@@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
> >
> >  	phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
> >  	if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
> >-		pr_err("unable to find transceiver\n");
> >+		dev_dbg(dev, "unable to find transceiver\n");
> 
>    Same here.

here he's using the caller's dev pointer, which is just fine.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux