[PATCH net-next 1/6] net: stmmac: add platform library

Russell King (Oracle) linux at armlinux.org.uk
Tue Sep 12 15:20:55 PDT 2023


On Tue, Sep 12, 2023 at 04:52:27PM +0200, Simon Horman wrote:
> On Mon, Sep 11, 2023 at 04:29:11PM +0100, Russell King (Oracle) wrote:
> > +	default:
> > +		return -ENOTSUPP;
> 
> Checkpatch seems to think that EOPNOTSUPP would be more appropriate
> as "ENOTSUPP is not a SUSV4 error code".

It needs to be an error code that clk_set_rate() below isn't going to
return - because if clk_set_rate() does return it, then the users are
going to end up issuing an incorrect error message to the user. I
suspect clk_set_rate() could quite legitimately return -EOPNOTSUPP
or -EINVAL.

Sadly, the CCF implementation of clk_set_rate() doesn't detail what
errors it could return, but it looks like -EBUSY, -EINVAL, or something
from pm_runtime_resume_and_get().

Interestingly, while looking at this, pm_runtime_resume_and_get() can
return '1' if e.g. rpm is disabled and the device is active. It looks
to me like CCF treats that as an error in multiple locations.

> > +	}
> > +
> > +	return clk_set_rate(tx_clk, rate);
> > +}
> > +EXPORT_SYMBOL_GPL(dwmac_set_tx_clk_gmii);

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list