Re: [PATCH v4] can: m_can: don't enable transceiver when probing

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

 



On 21.06.2024 14:49:08, Ratheesh Kannoth wrote:
> On 2024-06-07 at 16:22:08, Martin Hundebøll (martin@xxxxxxxxxx) wrote:
> >
> > -		usleep_range(1, 5);
> > +	/* Then clear the it again. */
> > +	ret = m_can_cccr_update_bits(cdev, CCCR_NISO, 0);
> > +	if (ret) {
> > +		dev_err(cdev->dev, "failed to revert the NON-ISO bit in CCCR\n");
> > +		return ret;
> >  	}
> >
> > -	/* Clear NISO */
> > -	cccr_reg &= ~(CCCR_NISO);
> > -	m_can_write(cdev, M_CAN_CCCR, cccr_reg);
> > +	ret = m_can_config_disable(cdev);
> > +	if (ret)
> > +		return ret;

> if ret != 0, then the function returns "true", right ?
> as indicated by the below comment. But as i understand,
> this is an error case and should return "false"

AFAICS: This patch changes the return type to int. It Returns 1 if the
bit is writable, 0 if it is not, or negative on error. The caller has
been adopted, too.

Marc

> > -	/* return false if time out (-ETIMEDOUT), else return true */
> > -	return !niso_timeout;
> > +	return niso == 0;
> >  }
> >
> >
> 
> 

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux