Re: [PATCH] hwmon: Add driver for EXYNOS4 TMU

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

 



On 2011년 08월 26일 01:26, Guenter Roeck wrote:
> On Thu, 2011-08-25 at 04:13 -0400, Donggeun Kim wrote:
>> +static void exynos4_tmu_initialize(struct platform_device *pdev)
>> +{
>> +       struct exynos4_tmu_data *data = platform_get_drvdata(pdev);
>> +       struct exynos4_tmu_platform_data *pdata = data->pdata;
>> +       unsigned int status, trim_info, interrupt_en;
>> +       u8 threshold_code;
>> +
>> +       clk_enable(data->clk);
>> +
>> +       status = readb(data->base + EXYNOS4_TMU_REG_STATUS);
>> +       if (!status) {
>> +               printk(KERN_INFO "TMU is busy\n");
> 
> Please use dev_info(&pdev->dev, ...);
> 
>> +               clk_disable(data->clk);
>> +               return;
> 
> Are you sure it is a good idea to ignore this error ? Limits won't be
> set, threshold won't be set, trigger levels won't be set. In other
> words, the chip is left in a completely uninitialized and thus
> unpredictable state.
> 
> It might be better to abort driver initialization if this happens.
> 
I should have handled this as a error. I will fix it.

>> +static int exynos4_tmu_read(struct exynos4_tmu_data *data, u8 *temp)
>> +{
>> +       u8 temp_code;
>> +
>> +       clk_enable(data->clk);
>> +
>> +       temp_code = readb(data->base + EXYNOS4_TMU_REG_CURRENT_TEMP);
>> +       if (!temp_code) {
>> +               dev_err(data->hwmon_dev, "Failed to read temperature code\n");
> 
> dev_err and EAGAIN ? Is this really necessary ? EAGAIN will result in a
> retry; if the condition is permanent you'll fill the log pretty quickly.
> 
Okay, it would be better to change the error code.

Thanks for your review.



_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux