Re: [RFC 1/4] net: fec: do not use readl()/writel() for ColdFire

Greg Ungerer <[email protected]>
Newsgroups org.kernel.vger.linux-m68k,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On 8/5/26 12:46, Wei Fang wrote:
>>   static void
>>   fec_stop(struct net_device *ndev)
>>   {
>>   	struct fec_enet_private *fep = netdev_priv(ndev);
>> -	u32 rmii_mode = readl(fep->hwp + FEC_R_CNTRL) & FEC_RCR_RMII;
>> +	u32 rmii_mode = fec_readl(fep->hwp + FEC_R_CNTRL) & FEC_RCR_RMII;
> 
> This is not an issue, but since you changed this line, the new code should
> follow the "reverse xmas tree" style.

Sure, will change in next version.

Thanks
Greg


> See: https://elixir.bootlin.com/linux/v7.0.1/source/Documentation/process/maintainer-netdev.rst#L380
> 
>>   	u32 val;
>>
>>   	/* We cannot expect a graceful transmit stop without link !!! */
>>   	if (fep->link) {
>> -		writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
>> +		fec_writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
>>   		udelay(10);
>> -		if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
>> +		if (!(fec_readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
>>   			netdev_err(ndev, "Graceful transmit stop did not complete!\n");
>>   	}
>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.