RE: [PATCH 01/11] usb: phy: return error on failure

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

 



> -----Original Message-----
> From: Felipe Balbi [mailto:balbi@xxxxxx]
> Sent: Tuesday, May 26, 2015 11:17 PM
> To: Kaukab, Yousaf
> Cc: linux-usb@xxxxxxxxxxxxxxx; balbi@xxxxxx
> Subject: Re: [PATCH 01/11] usb: phy: return error on failure
> 
> On Tue, May 05, 2015 at 04:14:35PM +0200, Mian Yousaf Kaukab wrote:
> > If the requested phy operation can't be done, return error instead of
> > success to let the caller know.
> >
> > Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@xxxxxxxxx>
> > ---
> >  include/linux/usb/phy.h | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index
> > bc91b5d..d2b03db 100644
> > --- a/include/linux/usb/phy.h
> > +++ b/include/linux/usb/phy.h
> > @@ -262,7 +262,7 @@ usb_phy_set_power(struct usb_phy *x, unsigned mA)
> > {
> >  	if (x && x->set_power)
> >  		return x->set_power(x, mA);
> > -	return 0;
> > +	return -EOPNOTSUPP;
> 
> the idea is that these operations are actually optional, so it's ok to return 0.

Caller can ignore the error if its optional for it. There are others who have put the similar validity checks  before usb phy api calls because they want to return error in case the call fails. We can remove such checks by returning the error here.

> 
> --
> Balbi

BR,
Yousaf
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux