lkml.org 
[lkml]   [2018]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/10] phy: Add configuration interface
> > > +int phy_configure(struct phy *phy, enum phy_mode mode,
> > > + union phy_configure_opts *opts)
> > > +{
> > > + int ret;
> > > +
> > > + if (!phy)
> > > + return -EINVAL;
> > > +
> > > + if (!phy->ops->configure)
> > > + return 0;
> >
> > Shouldn't you report an error to the caller ? If a caller expects the PHY to
> > be configurable, I would assume that silently ignoring the requested
> > configuration won't work great.
>
> I'm not sure. I also expect a device having to interact with multiple
> PHYs, some of them needing some configuration while some other do
> not. In that scenario, returning 0 seems to be the right thing to do.

You could return -EOPNOTSUPP. That is common in the network stack. The
caller then has the information to decide if it should keep going, or
return an error.

Andrew

\
 
 \ /
  Last update: 2018-09-06 18:26    [W:0.125 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site