Re: [PATCH v3] i2c: ocores: use devm_ managed clks

From: Christophe JAILLET
Date: Thu May 25 2023 - 15:27:26 EST


Le 25/05/2023 à 05:33, 张网 a écrit :
Hi Christophe,

Thanks for your suggestions. However, both clk_get_rate and clk_prepare_enable
will return 0 if i2c->clk is NULL, so I think we may not need to take this issue
into account.

Regards,
Wang Zhang


Ouch!

For some reaon, when I read:
> + rate = clk_get_rate(i2c->clk) / 1000;

I read "if i2c->clk is NULL, then the i2c pointer is NULL as well and is dereferenced".

:/

sorry for the noise.

CJ (slightly ashamed)