Re: [PATCH 1/1] rtc: mediatek: Add mt6685 RTC driver

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

 



On 31/10/2024 16:58, Krzysztof Kozlowski wrote:
>> +	regmap_write(rtc->regmap, RG_RTC_32K_CK_PDN_CLR, RG_RTC_32K_CK_PDN_MASK);
>> +	regmap_write(rtc->regmap, RG_RTC_MCLK_PDN_CLR, RG_RTC_MCLK_PDN_MASK);
>> +	counter++;
>> +	mdelay(1);
>> +	mutex_unlock(&rtc->clk_lock);
>> +}
>> +
>> +static void power_down_mclk(struct mt6685_rtc *rtc)
>> +{
>> +	mutex_lock(&rtc->clk_lock);
>> +	counter--;
>> +	if (counter < 0) {
>> +		//dump_stack();
>> +		pr_info("mclk_counter[%d]\n", counter);
> 
> Oh man... So many wrong things. This applies to entire code:
> 1. Drop dead code. All dead code.
> 
> 2. Do not use pr_xxx but dev_xxx
> 
> 3. Drop all such useless printks because your driver is supposed to be
> silent.
> 
> 4. Implement proper clock handling instead of reimplementing it yourself
> with some counters.

... clock handling or runtime PM, depending what this thing here really is.

Best regards,
Krzysztof





[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux